|
Firefish 0.5.10 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.lbl.dsd.util.Pair
A convenience class holding two elements, namely first
and second
,
either or both of which may be null
.
Constructor Summary | |
Pair(Object first,
Object second)
Constructs a pair with the given two elements, either or both of which may be null . |
Method Summary | |
boolean |
equals(Object other)
|
static boolean |
equals(Object xA,
Object yA,
Object xB,
Object yB)
Compares two 'pairs' x and y for equality. |
Object |
first()
Returns the first element of the pair. |
int |
hashCode()
|
static int |
hashCode(Object x,
Object y)
Returns the hashcode of the two elements of a 'pair'. |
Object |
second()
Returns the second element of the pair. |
String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Pair(Object first, Object second)
null
.
first
- the first element of the pair.second
- the second element of the pair.Method Detail |
public Object first()
public Object second()
public String toString()
public int hashCode()
public boolean equals(Object other)
public static boolean equals(Object xA, Object yA, Object xB, Object yB)
x
and y
for equality.
In other words determines xA.equals(yA)
and xB.equals(yB)
,
taking care of null
values.
This is a static method that avoids the inefficiency of temporary Pair
objects.
true
if the pair x
and the pair y
are equal; false
otherwise.public static int hashCode(Object x, Object y)
Pair
objects.
|
Firefish 0.5.10 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |