de.lmu.ifi.dbs.elki.utilities.pairs
Class SCPair<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.SCPair<FIRST,SECOND>
- Type Parameters:
FIRST - first type (comparable)SECOND - second type
- All Implemented Interfaces:
- Comparable<SCPair<FIRST,SECOND>>
public class SCPair<FIRST,SECOND extends Comparable<? super SECOND>>
- extends Pair<FIRST,SECOND>
- implements Comparable<SCPair<FIRST,SECOND>>
Pair that can only be compared by it's second component.
- Author:
- Erich Schubert
| Fields inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.Pair |
first, second |
SCPair
public SCPair(FIRST first,
SECOND second)
- Initialize pair
- Parameters:
first - first parametersecond - second parameter
compareTo
public int compareTo(SCPair<FIRST,SECOND> other)
- Generic derived compare function.
- Specified by:
compareTo in interface Comparable<SCPair<FIRST,SECOND extends Comparable<? super SECOND>>>
- Parameters:
other - Object to compare to
- Returns:
- comparison result
newArray
public static final <F,S extends Comparable<? super S>> SCPair<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