de.unidu.is.util
Class Tuple

java.lang.Object
  extended byde.unidu.is.util.Tuple

public class Tuple
extends java.lang.Object

A simple tuple, i.e. an array of objects. In contrast to an object array, this class provides convenient methods as well as implementations of equals(Object),hashCode() and toString().

Since:
2003-06-28
Version:
$Revision: 1.8 $, $Date: 2005/02/28 22:27:55 $
Author:
Henrik Nottelmann

Field Summary
protected  java.lang.Object[] array
          Array with the tuple values.
 
Constructor Summary
Tuple(java.lang.Object[] array)
          Creates a new object.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(int i)
          Returns the i-th object.
 double getDouble(int i)
          Returns the i-th object as a double.
 int getInt(int i)
          Returns the i-th object as an integer.
 java.lang.String getString(int i)
          Returns the i-th object as a string.
 int hashCode()
           
 int length()
          Returns the length, i.e. the number of objects.
 void set(int i, java.lang.Object o)
          Sets the i-th object.
 int size()
          Returns the length, i.e. the number of objects.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

array

protected java.lang.Object[] array
Array with the tuple values.

Constructor Detail

Tuple

public Tuple(java.lang.Object[] array)
Creates a new object.

Parameters:
array - objects
Method Detail

length

public int length()
Returns the length, i.e. the number of objects.

Returns:
number of objects

size

public int size()
Returns the length, i.e. the number of objects.

Returns:
number of objects

get

public java.lang.Object get(int i)
Returns the i-th object.

Parameters:
i - index number
Returns:
object at this index number

set

public void set(int i,
                java.lang.Object o)
Sets the i-th object.

Parameters:
i - index number
o - object to be set at this index number

getDouble

public double getDouble(int i)
Returns the i-th object as a double.

Parameters:
i - index number
Returns:
object at this index number

getInt

public int getInt(int i)
Returns the i-th object as an integer.

Parameters:
i - index number
Returns:
object at this index number

getString

public java.lang.String getString(int i)
Returns the i-th object as a string.

Parameters:
i - index number
Returns:
object at this index number

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()