|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.lindfors.util.Pair
public class Pair
A container class for holding key, value pairs.
Every effort has been made to try to achieve thread-safety in Pair class. Of course, this doesn't mean bugs and nasty race conditions or dead locks don't exist. I'm just not aware of them :)
For more detailed documentation, refer to the Util Library Developer's Guide
Constructor Summary | |
---|---|
Pair(java.lang.Object key,
java.lang.Object value)
Constructs a key, value pair. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Performs a shallow copy to this object. |
java.lang.Object |
getKey()
Returns the key object of this pair. |
java.lang.Object |
getValue()
Returns the value object of this pair. |
void |
setPair(java.lang.Object key,
java.lang.Object value)
Sets key and value for this pair. |
void |
setPair(Pair pair)
Sets key and value for this pair. |
java.lang.String |
toString()
Returns a textual representation of this object. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pair(java.lang.Object key, java.lang.Object value)
key
- key of this pairvalue
- value of this pairMethod Detail |
---|
public java.lang.Object getValue()
public java.lang.Object getKey()
public void setPair(java.lang.Object key, java.lang.Object value)
key
- key of this pairvalue
- value of this pairpublic void setPair(Pair pair)
pair
- Pair to be copied into this objectpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
methods of both key and value objects
to build the text string.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |