net.sf.tuplespace.simple
Class SimpleTuple

java.lang.Object
  extended bynet.sf.tuplespace.simple.SimpleTuple
All Implemented Interfaces:
Tuple

public class SimpleTuple
extends Object
implements Tuple

A simple implementation of Tuple which stores the objects in an array.


Constructor Summary
SimpleTuple(Object value0)
           
SimpleTuple(Object[] values)
           
SimpleTuple(Object value0, Object value1)
           
SimpleTuple(Object value0, Object value1, Object value2)
           
 
Method Summary
 boolean equals(Object o)
          Tuples can be equal to each other if they have the same values in the same positions.
 Object getValueAt(int index)
          Returns the object held at index index in the tuple.
 int hashCode()
           
 int length()
          Returns the length of this tuple.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleTuple

public SimpleTuple(Object value0)

SimpleTuple

public SimpleTuple(Object value0,
                   Object value1)

SimpleTuple

public SimpleTuple(Object value0,
                   Object value1,
                   Object value2)

SimpleTuple

public SimpleTuple(Object[] values)
Method Detail

getValueAt

public Object getValueAt(int index)
                  throws IllegalArgumentException
Description copied from interface: Tuple
Returns the object held at index index in the tuple.

Specified by:
getValueAt in interface Tuple
Parameters:
index - The object's index, from 0 to Tuple.length()-1.
Returns:
The object held at index index.
Throws:
IllegalArgumentException - If index is out of range.

length

public int length()
Description copied from interface: Tuple
Returns the length of this tuple.

Specified by:
length in interface Tuple
Returns:
The length of the tuple.

equals

public boolean equals(Object o)
Tuples can be equal to each other if they have the same values in the same positions.

Parameters:
o - The other tuple to test equality against.
Returns:
true if both tuples have the same values in the same order.

hashCode

public int hashCode()

toString

public String toString()