edu.washington.cs.rfid.util
Class Pair<One,Two>

java.lang.Object
  extended by edu.washington.cs.rfid.util.Pair<One,Two>
Type Parameters:
One -
Two -

public class Pair<One,Two>
extends java.lang.Object

A generic class for encapsulating a pair of any two objects.

Author:
Jordan, Evan

Constructor Summary
Pair(One one, Two two)
          Creates a new Pair using the specified objects.
 
Method Summary
static
<A,B> Pair<A,B>
create(A one, B two)
          Static method for creating a new pair of objects.
static boolean equal(java.lang.Object o1, java.lang.Object o2)
          Static method to returns true if the given object pair matches this Pair, false o/w.
 boolean equals(java.lang.Object o)
          Returns true if the given object matches this Pair, false o/w.
 One getOne()
          Returns the first object
 Two getTwo()
          Returns the second object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(One one,
            Two two)
Creates a new Pair using the specified objects.

Parameters:
one - The first object
two - The second object
Method Detail

create

public static <A,B> Pair<A,B> create(A one,
                                     B two)
Static method for creating a new pair of objects.

Type Parameters:
A - The type of the first object
B - The type of the second object
Parameters:
one - The first object
two - The second object
Returns:
The created Pair

getOne

public One getOne()
Returns the first object

Parameters:
The - first object

getTwo

public Two getTwo()
Returns the second object.

Returns:
The second object

equals

public final boolean equals(java.lang.Object o)
Returns true if the given object matches this Pair, false o/w.

Overrides:
equals in class java.lang.Object
Returns:
True if the given object matches this Pair, false o/w

equal

public static final boolean equal(java.lang.Object o1,
                                  java.lang.Object o2)
Static method to returns true if the given object pair matches this Pair, false o/w.

Parameters:
o1 - The first object
o2 - The second object
Returns:
True if the given object pair matches this Pair, false o/w