T
- the generic type of the pair's first componentS
- the generic type of the pair's second componentpublic class Pair<T,S>
extends java.lang.Object
Constructor and Description |
---|
Pair(T first,
S second)
Constructs a pair.
|
Modifier and Type | Method and Description |
---|---|
T |
getFirst()
Returns the pair's first component.
|
S |
getSecond()
Returns the pair's second component.
|
void |
setFirst(T first)
Sets the pair's first component.
|
void |
setSecond(S second)
Sets the pair's second component.
|
java.lang.String |
toString() |
public T getFirst()
public S getSecond()
public void setFirst(T first)
first
- the pair's first componentpublic void setSecond(S second)
second
- the pair's second componentpublic java.lang.String toString()
toString
in class java.lang.Object