com.maryanovsky.gwtutils.client
Class Pair

java.lang.Object
  extended by com.maryanovsky.gwtutils.client.Pair

public final class Pair
extends Object

A wrapper for any two other given objects.

Author:
Maryanovsky Alexander

Constructor Summary
Pair(Object first, Object second)
          Creates a new Pair with the two given objects.
 
Method Summary
 boolean equals(Object o)
          Returns true iff the given Object is a Pair, and its two objects are the same as this one's (comparison done via Utilities.areEqual)
 Object getFirst()
          Returns the first object.
 Object getSecond()
          Returns the second object.
 int hashCode()
          Returns a hashcode combined from the hashcodes of the two target objects.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(Object first,
            Object second)
Creates a new Pair with the two given objects. Either of the objects may be null.

Method Detail

getFirst

public Object getFirst()
Returns the first object.


getSecond

public Object getSecond()
Returns the second object.


hashCode

public int hashCode()
Returns a hashcode combined from the hashcodes of the two target objects.

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Returns true iff the given Object is a Pair, and its two objects are the same as this one's (comparison done via Utilities.areEqual)

Overrides:
equals in class Object