Constructor and Description |
---|
Pair()
Creates an empty Pair.
|
Pair(T1 o1,
T2 o2)
Creates a Pair with objects o1 and o2.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Pair<T1,T2> o) |
boolean |
equals(java.lang.Object o) |
T1 |
first()
Retrieves the first object.
|
T2 |
second()
Retrieves the second object.
|
void |
setFirst(T1 o)
Sets the first object.
|
void |
setSecond(T2 o)
Sets the second object.
|
java.lang.String |
toString() |
public T1 first()
public T2 second()
public void setFirst(T1 o)
o
- first objectpublic void setSecond(T2 o)
o
- second objectpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object