Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

Package de.lmu.ifi.dbs.elki.utilities.pairs

Pairs and triples utility classes.

See:
          Description

Class Summary
CPair<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Pair with canonical comparison function derived from the components comparable interfaces.
CTriple<FIRST extends Comparable<FIRST>,SECOND extends Comparable<SECOND>,THIRD extends Comparable<THIRD>> Triple with canonical comparison function.
DoubleDoublePair Pair storing two doubles.
DoubleIntPair Pair storing an integer and a double.
FCPair<FIRST extends Comparable<? super FIRST>,SECOND> Pair that can only be compared by it's first component.
IntDoublePair Pair storing an integer and a double.
IntIntPair Pair storing two integers.
Pair<FIRST,SECOND> Generic SimplePair class.
PairUtil Utility functions for Pair classes.
PairUtil.Compare<FIRST,SECOND> Compare two SimplePairs based on two comparators
PairUtil.CompareByFirst<FIRST,SECOND> Compare two SimplePairs based on a comparator for the first component.
PairUtil.CompareBySecond<FIRST,SECOND> Compare two SimplePairs based on a comparator for the second component.
PairUtil.CompareNatural<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Class to do a "natural order" comparison on this class.
PairUtil.CompareNaturalFirst<FIRST extends Comparable<? super FIRST>,SECOND> Class to do a natural comparison on this class' first component.
PairUtil.CompareNaturalSecond<FIRST,SECOND extends Comparable<? super SECOND>> Class to do a natural comparison on this class' second component.
PairUtil.CompareNaturalSwapped<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Class to do a canonical swapped comparison on this class.
PairUtil.CompareSwapped<FIRST,SECOND> Compare two SimplePairs based on two comparators, but by second component first.
SCPair<FIRST,SECOND extends Comparable<? super SECOND>> Pair that can only be compared by it's second component.
Triple<FIRST,SECOND,THIRD> Triple without comparison.
 

Package de.lmu.ifi.dbs.elki.utilities.pairs Description

Pairs and triples utility classes.

Pairs and Triples are frequently used classes and reimplemented too often.

Due to limitations in object subclassing, CPair cannot be a subclass of FCPair, since a class cannot implement the Comparable interface twice.

Also primitive types cannot be used in Generics, resulting in the following classes for primitive types:

Triples can be used via:

If you need a triple comparable in just particular components, either define a comparator for sorting or subclass Triple appropriately.


Release 0.3 (2010-03-31_1612)