|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.util.Pair
public class Pair
Provides a mechanism to group any two objects. Either or both objects
may be null
.
Field Summary | |
---|---|
Object |
first
The first object in the pair. |
Object |
second
The second object in the pair. |
Constructor Summary | |
---|---|
Pair()
Constructs a new Pair object with both data members
set to null . |
|
Pair(Object first,
Object second)
Constructs a new Pair object with the specified two
objects. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Returns true if and only if
the specified object is an instance of Pair and
if this.first and ((Pair)obj).first are
either both null or are equal as determined by the
equals method of this.first
if this.second and ((Pair)obj).second are
either both null or are equal as determined by the
equals method of this.second
|
int |
hashCode()
Returns a hash code that is formed from the hash codes of the two objects of this pair. |
String |
toString()
Returns a human-readable string representation of this pair of objects, of the form "Pair(" + first + ", " + second + ")" |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Object first
public Object second
Constructor Detail |
---|
public Pair()
Pair
object with both data members
set to null
.
public Pair(Object first, Object second)
Pair
object with the specified two
objects.
Method Detail |
---|
public boolean equals(Object obj)
true
if and only if
Pair
and
this.first
and ((Pair)obj).first
are
either both null
or are equal as determined by the
equals
method of this.first
this.second
and ((Pair)obj).second
are
either both null
or are equal as determined by the
equals
method of this.second
equals
in class Object
public int hashCode()
null
,
then its effective hash code as calculated by this method is 0.
hashCode
in class Object
public String toString()
"Pair(" + first + ", " + second + ")"
toString
in class Object
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |