FIRST - first typeSECOND - second typepublic class Pair<FIRST,SECOND>
extends java.lang.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(java.lang.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.
|
void |
setFirst(FIRST first)
Setter for first
|
void |
setSecond(SECOND second)
Setter for second
|
java.lang.String |
toString()
Canonical toString operator
|
public FIRST first
public SECOND second
public java.lang.String toString()
toString in class java.lang.Objectpublic 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 boolean equals(java.lang.Object obj)
first and second element of
this Pair equal the first and second element,
respectively, of the other Pair.equals in class java.lang.Objectobj - Object to compare topublic final int hashCode()
hashCode in class java.lang.ObjectCopyright © 2019 ELKI Development Team. License information.