FIRST
- first typeSECOND
- second typepublic class Pair<FIRST,SECOND> extends Object implements PairInterface<FIRST,SECOND>
CPair
if you want comparable pairs.Modifier and Type | Field and Description |
---|---|
FIRST |
first
First value in pair
|
SECOND |
second
Second value in pair
|
Constructor and Description |
---|
Pair(FIRST first,
SECOND second)
Initialize pair
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Simple equals statement.
|
FIRST |
getFirst()
Getter for first
|
SECOND |
getSecond()
Getter for second element in pair
|
int |
hashCode()
Canonical hash function, mixing the two hash values.
|
static <F,S> Pair<F,S>[] |
newPairArray(int size)
Create a new array of the given size (for generics)
|
void |
setFirst(FIRST first)
Setter for first
|
void |
setSecond(SECOND second)
Setter for second
|
String |
toString()
Canonical toString operator
|
public FIRST first
public SECOND second
public final FIRST getFirst()
getFirst
in interface PairInterface<FIRST,SECOND>
public final void setFirst(FIRST first)
first
- new value for first elementpublic final SECOND getSecond()
getSecond
in interface PairInterface<FIRST,SECOND>
public final void setSecond(SECOND second)
second
- new value for second elementpublic static final <F,S> Pair<F,S>[] newPairArray(int size)
F
- First classS
- Second classsize
- array sizepublic boolean equals(Object obj)