edu.uci.ics.jung.utils
Class Pair

java.lang.Object
  extended by edu.uci.ics.jung.utils.Pair

public final class Pair
extends Object

Stores a pair of values together. Access either one by directly getting the fields. Pairs are not mutable, respect equals and may be used as indices.

Note that they do not protect from malevolent behavior: if one or another object in the tuple is mutable, then that can be changed with the usual bad effects.

Author:
scott white and Danyel Fisher

Constructor Summary
Pair(Object value1, Object value2)
           
 
Method Summary
 boolean equals(Object o)
           
 Object getFirst()
           
 Object getSecond()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(Object value1,
            Object value2)
Method Detail

getFirst

public Object getFirst()

getSecond

public Object getSecond()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object