|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.checkstyle.util.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 | |
|---|---|
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()
|
void |
setHead(H newHead)
Modifies the head object of the pair. |
void |
setTail(T newTail)
Modifies the tail object of the pair. |
| 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 H getHead()
setHead(H),
getTail()public void setHead(H newHead)
newHead - the new head object of the pairgetHead()public T getTail()
setTail(T),
getHead()public void setTail(T newTail)
newTail - new tail object of the pairgetTail()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 | |||||||||