spase.parser120
Class Pair<L,R>

java.lang.Object
  extended by spase.parser120.Pair<L,R>

public class Pair<L,R>
extends java.lang.Object

An simple class to maintain pairs of objects. Adapted form a web post.

Since:
1.0.0

Constructor Summary
Pair(L left, R right)
          Creates an instance of pair with a "left" value and a "right" value.
 
Method Summary
static
<A,B> Pair<A,B>
create(A left, B right)
          Creates an instance of pair with a "left" value and a "right" value.
static boolean equal(java.lang.Object o1, java.lang.Object o2)
          Determines if one object equals another.
 boolean equals(java.lang.Object o)
          Determines if one object equals another.
 L getLeft()
          Returns the "right" element of the pair.
 R getRight()
          Returns the "right" element of the pair.
 int hashCode()
          Returns the hash code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(L left,
            R right)
Creates an instance of pair with a "left" value and a "right" value.

Since:
1.0
Method Detail

create

public static <A,B> Pair<A,B> create(A left,
                                     B right)
Creates an instance of pair with a "left" value and a "right" value. The type of each value can be defined.

Since:
1.0

getRight

public R getRight()
Returns the "right" element of the pair.

Since:
1.0

getLeft

public L getLeft()
Returns the "right" element of the pair.

Since:
1.0

equals

public final boolean equals(java.lang.Object o)
Determines if one object equals another. This checks if the content of each object is the same.

Overrides:
equals in class java.lang.Object
Returns:
true if the content is the same; false otherwise.
Since:
1.0

equal

public static final boolean equal(java.lang.Object o1,
                                  java.lang.Object o2)
Determines if one object equals another. This checks if the content of each object is the same.

Returns:
true if the content is the same; false otherwise.
Since:
1.0

hashCode

public int hashCode()
Returns the hash code. This checks if the content of each object is the same.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value.
Since:
1.0