T1
- the type of the left item in the pairT2
- the type of the right item in the pairpublic class Pair<T1,T2> extends java.lang.Object implements java.util.Map.Entry<T1,T2>, java.lang.Comparable<Pair<T1,T2>>, java.io.Serializable
Constructor and Description |
---|
Pair(Pair<T1,T2> pair) |
Pair(T1 left,
T2 right) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Pair<T1,T2> other) |
boolean |
equals(java.lang.Object obj) |
T1 |
getKey() |
T1 |
getLeft()
Gets the left item in the pair
|
T2 |
getRight()
Gets the right item in the pair
|
T2 |
getValue() |
int |
hashCode() |
void |
setKey(T1 key)
Replaces the key corresponding to this entry with the specified key
(optional operation).
|
void |
setLeft(T1 left)
Sets the left item in the pair
|
void |
setRight(T2 right)
Sets the right item in the pair
|
T2 |
setValue(T2 value) |
java.lang.String |
toString() |
public boolean equals(java.lang.Object obj)
public T1 getLeft()
public T2 getRight()
public int hashCode()
public void setKey(T1 key)
key
- the new key for the pairpublic void setLeft(T1 left)
left
- the new left item for the pairpublic void setRight(T2 right)
right
- the new right item for the pairpublic java.lang.String toString()
toString
in class java.lang.Object