net.sf.swan.util
Class Tuple

java.lang.Object
  |
  +--net.sf.swan.util.Tuple
All Implemented Interfaces:
java.lang.Cloneable

public final class Tuple
extends java.lang.Object
implements java.lang.Cloneable

Class for holding arbitrary tuples, and which can be used as a key for Maps.


Constructor Summary
Tuple()
           
Tuple(java.lang.Object[] values)
           
Tuple(java.lang.Object valueOne, java.lang.Object valueTwo)
           
 
Method Summary
 java.lang.Object clone()
           
 int count()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(int index)
           
 int hashCode()
           
 void set(java.lang.Object[] values)
          Reset the key.
 void set(java.lang.Object valueOne, java.lang.Object valueTwo)
          Reset the key.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tuple

public Tuple()

Tuple

public Tuple(java.lang.Object[] values)

Tuple

public Tuple(java.lang.Object valueOne,
             java.lang.Object valueTwo)
Method Detail

set

public void set(java.lang.Object valueOne,
                java.lang.Object valueTwo)
Reset the key. This should never be called on a key that is being used by a Map. This method is simply to permit reuse of key objects for searching.

set

public void set(java.lang.Object[] values)
Reset the key. This should never be called on a key that is being used by a Map. This method is simply to permit reuse of key objects for searching.

equals

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

hashCode

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

count

public int count()

get

public java.lang.Object get(int index)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

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