Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.pairs
Class CPair<FIRST extends Comparable<? super 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.CPair<FIRST,SECOND>
Type Parameters:
FIRST - first type
SECOND - second type
All Implemented Interfaces:
Comparable<CPair<FIRST,SECOND>>
Direct Known Subclasses:
DistanceResultPair

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.

Author:
Erich Schubert

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.Pair
first, second
 
Constructor Summary
CPair(FIRST first, SECOND second)
          Initialize pair
 
Method Summary
 int compareTo(CPair<FIRST,SECOND> other)
          Generic derived compare function.
static
<F extends Comparable<? super F>,S extends Comparable<? super S>>
CPair<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

CPair

public CPair(FIRST first,
             SECOND second)
Initialize pair

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

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

Release 0.3 (2010-03-31_1612)