Jadex 0.941

jadex.util
Class Tuple

java.lang.Object
  extended byjadex.util.Tuple
All Implemented Interfaces:
Cloneable, Serializable

public class Tuple
extends Object
implements Cloneable, Serializable

A tuple is a list of entities. The entities of a tuple may be null. The equals and hashCode methods are overridden, such that two tuples are equal and have the same hashcode, if they contain the same entities. Therefore tuples can be used for multipart keys in hashtables.

See Also:
Hashtable, Object.hashCode(), Object.equals(Object), Serialized Form

Constructor Summary
Tuple(Object[] entities)
          Create a new tuple.
Tuple(Object entity1, Object entity2)
          Convenience constructor for binary tuples.
 
Method Summary
 Object clone()
          Clone this tuple.
 boolean equals(Object o)
          Test two tuples for equality.
 Object get(int n)
          Get an entity.
 Object[] getEntities()
          Get entities
 Object getEntity(int n)
          Get an entity.
 int hashCode()
          Compute the hashcode of the tuple.
 int size()
          Get the size.
 String toString()
          Convert this tuple to a string representation.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tuple

public Tuple(Object entity1,
             Object entity2)
Convenience constructor for binary tuples.

Parameters:
entity1 - The first object in the tuple.
entity2 - The second object in the tuple.

Tuple

public Tuple(Object[] entities)
Create a new tuple.

Parameters:
entities - The objects in the tuple.
Method Detail

getEntity

public Object getEntity(int n)
Get an entity.

Parameters:
n - The entities position.
Returns:
The entity.

getEntities

public Object[] getEntities()
Get entities

Returns:
The entities.

get

public Object get(int n)
Get an entity.

Parameters:
n - The entities position.
Returns:
The entity.

size

public int size()
Get the size.

Returns:
The size.

hashCode

public int hashCode()
Compute the hashcode of the tuple.


equals

public boolean equals(Object o)
Test two tuples for equality.


toString

public String toString()
Convert this tuple to a string representation.

Returns:
A string representation of this tuple.

clone

public Object clone()
Clone this tuple.

Returns:
A shallow copy of this tuple.

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.