de.lmu.ifi.dbs.elki.utilities.pairs
Class CPair<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>>
java.lang.Object
de.lmu.ifi.dbs.elki.utilities.pairs.Pair<FIRST,SECOND>
de.lmu.ifi.dbs.elki.utilities.pairs.CPair<FIRST,SECOND>
- Type Parameters:
FIRST
- first typeSECOND
- second type
- All Implemented Interfaces:
- PairInterface<FIRST,SECOND>, Comparable<CPair<FIRST,SECOND>>
public class CPair<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>>
- extends Pair<FIRST,SECOND>
- implements Comparable<CPair<FIRST,SECOND>>
Pair with canonical comparison function derived from the components comparable interfaces.
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.Pair |
first, second |
CPair
public CPair(FIRST first,
SECOND second)
- Initialize pair
- Parameters:
first
- first parametersecond
- second parameter
compareTo
public int compareTo(CPair<FIRST,SECOND> other)
- Generic derived compare function.
- Specified by:
compareTo
in interface Comparable<CPair<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>>>
- Parameters:
other
- Object to compare to
- Returns:
- comparison result
newArray
public static final <F extends Comparable<? super F>,S extends Comparable<? super S>> CPair<F,S>[] newArray(int size)
- Array constructor for generics
- Type Parameters:
F
- First typeS
- Second type- Parameters:
size
- Size of array to be constructed
- Returns:
- New array of requested size