|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjbil.common.Pair<E,F>
E - The type of the first element.F - The type of the second element.public class Pair<E,F>
Utility 'generalised' class representing a pair of values with not necessarily identical types.
| Field Summary | |
|---|---|
E |
first
The first element |
F |
second
The second element |
| Constructor Summary | |
|---|---|
Pair()
Creates a new (null,null) pair. |
|
Pair(E first,
F second)
Creates a new pair with specified elements. |
|
| Method Summary | |
|---|---|
boolean |
contains(java.lang.Object o)
Checks if the pair contains one given element. |
boolean |
equals(java.lang.Object other)
|
java.lang.Object |
get(int index)
Gets an element from its index: 0=first, 1=second. |
int |
hashCode()
|
Pair<F,E> |
invert()
Creates a new pair with the same elements of this pair in inversed order. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public E first
public F second
| Constructor Detail |
|---|
public Pair()
public Pair(E first,
F second)
first - The first element.second - The second element.| Method Detail |
|---|
public java.lang.Object get(int index)
index - The index of the element.
java.lang.IndexOutOfBoundsExceptionpublic Pair<F,E> invert()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean contains(java.lang.Object o)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||