FIRST
- first typeSECOND
- second typepublic class CPair<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> extends Pair<FIRST,SECOND> implements Comparable<CPair<FIRST,SECOND>>
Constructor and Description |
---|
CPair(FIRST first,
SECOND second)
Initialize pair
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CPair<FIRST,SECOND> other)
Generic derived compare function.
|
static <F extends Comparable<? super F>,S extends Comparable<? super S>> |
newArray(int size)
Array constructor for generics
|
public int compareTo(CPair<FIRST,SECOND> other)
compareTo
in interface Comparable<CPair<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>>>
other
- Object to compare topublic static final <F extends Comparable<? super F>,S extends Comparable<? super S>> CPair<F,S>[] newArray(int size)
F
- First typeS
- Second typesize
- Size of array to be constructed