A
- the type of the first object in this pairB
- the type of the second object in this pairpublic class Pair<A,B>
extends java.lang.Object
Constructor and Description |
---|
Pair(A a,
B b)
Constructor that sets the both objects in this pair
|
Modifier and Type | Method and Description |
---|---|
A |
getA()
Provides the first object in this pair
|
B |
getB()
Provides the second object in this pair
|
void |
set(A a,
B b)
Sets the both objects in this pair
|
void |
setA(A a)
Sets the first object in this pair
|
void |
setB(B b)
Sets the second object in this pair
|
java.lang.String |
toString()
Provides a string representation of the pair in the form (a, b)
|
public void set(A a, B b)
a
- the first object of this pairb
- the second object of this pairpublic void setA(A a)
a
- the first object of this pairpublic void setB(B b)
b
- the second object of this pairpublic A getA()
public B getB()
public java.lang.String toString()
toString
in class java.lang.Object