CITS2200
Class Pair

java.lang.Object
  extended by CITS2200.Pair

public class Pair
extends Object

A pair (2-tuple) of information.


Field Summary
 Object item1
          the first item (or domain item)
 Object item2
          the second item (or codomain item)
 
Constructor Summary
Pair(Object i1, Object i2)
          create a new pair
 
Method Summary
 boolean equals(Object o)
          determine whether this pair is the same as the object passed checks that both items are the same using the items' equals methods
 String toString()
          generate a string representation of the pair of the form < item1 , item2 >
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

item1

public Object item1
the first item (or domain item)


item2

public Object item2
the second item (or codomain item)

Constructor Detail

Pair

public Pair(Object i1,
            Object i2)
create a new pair

Parameters:
i1 - the first item
i2 - the second item
Method Detail

equals

public boolean equals(Object o)
determine whether this pair is the same as the object passed checks that both items are the same using the items' equals methods

Overrides:
equals in class Object
Parameters:
o - the object to be compared
Returns:
true if the pairs are the same, false otherwise

toString

public String toString()
generate a string representation of the pair of the form < item1 , item2 >

Overrides:
toString in class Object
Returns:
the string generated