org.graffiti.util
Class Pair<S,T>

java.lang.Object
  extended by org.graffiti.util.Pair<S,T>

public class Pair<S,T>
extends Object

Encapsulates two values.

Version:
$Revision: 5767 $
Author:
Paul, Andreas Gleißner

Constructor Summary
Pair()
          Creates a new Pair object.
Pair(S first, T second)
          Creates a new Pair object.
 
Method Summary
static
<U,V> Pair<U,V>
create(U first, V second)
           
 boolean equals(Object obj)
          
 S getFirst()
          Returns the first object.
 S getFst()
          Returns the first object.
 T getSecond()
          Returns the second object.
 T getSnd()
          Returns the second object.
 int hashCode()
          
 void setFirst(S first)
          Sets the first object.
 void setSecond(T second)
          Sets the second object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair()
Creates a new Pair object.


Pair

public Pair(S first,
            T second)
Creates a new Pair object.

Parameters:
first - the first object.
second - the second object.
Method Detail

create

public static <U,V> Pair<U,V> create(U first,
                                     V second)

getFirst

public S getFirst()
Returns the first object.

Returns:
the first object.

getFst

public S getFst()
Returns the first object.

Returns:
the first object.

setFirst

public void setFirst(S first)
Sets the first object.

Parameters:
first - the first object.

getSecond

public T getSecond()
Returns the second object.

Returns:
the second object.

getSnd

public T getSnd()
Returns the second object.

Returns:
the second object.

setSecond

public void setSecond(T second)
Sets the second object.

Parameters:
second - the second object.

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
Returns:
true if obj is a Pair and both pairs equal in first and second;
false otherwise.

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Generated at 2012-05-30 11:00:14 PM CEST