F - The type of the first element of the pair.S - The type of the second element of the pair.public class Pair<F,S>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected F |
first
The first element of the pair.
|
protected S |
second
The second element of the pair.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Pair()
Default constructor for serialisation.
|
|
Pair(F first,
S second)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
F |
getFirst() |
S |
getSecond() |
int |
hashCode() |
static <F,S> Pair<F,S> |
pair(F f,
S s)
Create a new pair.
|
java.lang.String |
toString() |
protected F first
final is not
possible.protected S second
final is not
possible.protected Pair()
public F getFirst()
public S getSecond()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static <F,S> Pair<F,S> pair(F f, S s)
f - Firsts - Second