de.lmu.ifi.dbs.elki.utilities.pairs
Class SCPair<FIRST,SECOND extends Comparable<? super SECOND>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.pairs.Pair<FIRST,SECOND>
      extended by de.lmu.ifi.dbs.elki.utilities.pairs.SCPair<FIRST,SECOND>
Type Parameters:
FIRST - first type (comparable)
SECOND - second type
All Implemented Interfaces:
PairInterface<FIRST,SECOND>, 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.


Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.Pair
first, second
 
Constructor Summary
SCPair(FIRST first, SECOND second)
          Initialize pair
 
Method Summary
 int compareTo(SCPair<FIRST,SECOND> other)
          Generic derived compare function.
static
<F,S extends Comparable<? super S>>
SCPair<F,S>[]
newArray(int size)
          Array constructor for generics
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.Pair
equals, getFirst, getSecond, hashCode, newPairArray, setFirst, setSecond, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SCPair

public SCPair(FIRST first,
              SECOND second)
Initialize pair

Parameters:
first - first parameter
second - second parameter
Method Detail

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 type
S - Second type
Parameters:
size - Size of array to be constructed
Returns:
New array of requested size

Release 0.4.0 (2011-09-20_1324)