jfun.parsec
Class Pair<A,B>

java.lang.Object
  extended by jfun.parsec.Pair<A,B>
Type Parameters:
A -
B -
Direct Known Subclasses:
Tuple3

public class Pair<A,B>
extends java.lang.Object

This is a simple Java Bean for a pair of objects.

Since:
version 1.1
Author:
Ben Yu Apr 24, 2006 1:41:52 PM

Constructor Summary
Pair()
           
Pair(A a, B b)
          To create a Pair object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean equals(Pair other)
           
 A getValue1()
          Get the first value.
 B getValue2()
          Get the second value.
 int hashCode()
           
 void setValue1(A value1)
          Set the first value.
 void setValue2(B value2)
          Set the second value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair()

Pair

public Pair(A a,
            B b)
To create a Pair object.

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

getValue1

public A getValue1()
Get the first value.


setValue1

public void setValue1(A value1)
Set the first value.


getValue2

public B getValue2()
Get the second value.


setValue2

public void setValue2(B value2)
Set the second value.


equals

public boolean equals(Pair other)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object