jcommon.graph
Class Pair<TValue1,TValue2>

java.lang.Object
  extended by jcommon.graph.Pair<TValue1,TValue2>
Type Parameters:
TValue1 - Type associated with the first value.
TValue2 - Type associated with the second value.
Direct Known Subclasses:
AdjacencyListPair

public class Pair<TValue1,TValue2>
extends Object

Associates two values together. Effectively a tuple of arity 2.


Constructor Summary
Pair(TValue1 value1, TValue2 value2)
          Creates a new instance of Pair.
 
Method Summary
 boolean equals(Object obj)
           
 TValue1 getValue1()
          Retrieves a reference to the first value provided.
 TValue2 getValue2()
          Retrieves a reference to the second value provided.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(TValue1 value1,
            TValue2 value2)
Creates a new instance of Pair.

Parameters:
value1 - The first value.
value2 - The second value.
Method Detail

getValue1

public TValue1 getValue1()
Retrieves a reference to the first value provided.

Returns:
A reference to the first value.

getValue2

public TValue2 getValue2()
Retrieves a reference to the second value provided.

Returns:
A reference to the second value.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Parameters:
obj - The reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
A hash code value for the Pair.
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object
Returns:
A string representing the Pair.
See Also:
Object.toString()


Copyright © 2012-2013. All Rights Reserved.