FIRST
- first typeSECOND
- second typepublic class Pair<FIRST,SECOND> extends Object
Integer
and
Double
- avoid the memory waste and garbage collection overhead!
Does not implement any "special" interfaces such as Comparable. If you need
more complicated pairs, please use domain specific code, with more
meaningful field names and comparators.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()
public final void setFirst(FIRST first)
first
- new value for first elementpublic final SECOND getSecond()
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)
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.