|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.im.tools.Pair<H,T>
H - Type of the headT - Type of the tailpublic final class Pair<H,T>
Pair is a helper class for the frequent case, when two objects
must be combined for a collection entry or even a key. The concept of a pair
is fundamental for all languages derived from LISP and is even useful in a
language like Java.
Note: Pairs may be used as keys for a hash collection, when
both elements, named head and tail, implements the hashing protocol.
| Constructor Summary | |
|---|---|
Pair(H head,
T tail)
Constructs a Pair using the two given objects as head and
tail. |
|
| Method Summary | ||
|---|---|---|
static
|
create(H2 head,
T2 tail)
|
|
boolean |
equals(java.lang.Object other)
|
|
H |
getHead()
Returns the head object of the pair. |
|
T |
getTail()
Returns the tail object of the pair. |
|
int |
hashCode()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Pair(H head,
T tail)
Pair using the two given objects as head and
tail.
head - the object to be used as the head of the pairtail - the object to be used as the tail of the pair| Method Detail |
|---|
public static <H2,T2> Pair<H2,T2> create(H2 head,
T2 tail)
public H getHead()
getTail()public T getTail()
getHead()public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||