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<FIRST>,SECOND extends Comparable<SECOND>> Pair with canonical comparison function derived from generics.
CPair.CompareSwapped<FIRST extends Comparable<FIRST>,SECOND extends Comparable<SECOND>> Class to do a canonical swapped comparison on this class.
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<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.
Pair.Compare<FIRST,SECOND> Compare two SimplePairs based on two comparators
Pair.CompareByFirst<FIRST,SECOND> Compare two SimplePairs based on a comparator for the first component.
Pair.CompareBySecond<FIRST,SECOND> Compare two SimplePairs based on a comparator for the second component.
Pair.CompareSwapped<FIRST,SECOND> Compare two SimplePairs based on two comparators, but by second component first.
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.2.1 (2009-07-13_1605)