Package jadex.commons
Class Tuple
- java.lang.Object
- 
- jadex.commons.Tuple
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 
 public class Tuple extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableA 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
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.Object[]entitiesThe entities of the tuple.
 - 
Constructor SummaryConstructors Constructor Description Tuple(java.lang.Object[] entities)Create a new tuple.Tuple(java.lang.Object entity1, java.lang.Object entity2)Convenience constructor for binary tuples.Tuple(java.lang.Object entity1, java.lang.Object entity2, java.lang.Object entity3)Convenience constructor for binary tuples.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clone this tuple.booleanequals(java.lang.Object o)Test two tuples for equality.java.lang.Objectget(int n)Get an entity.java.lang.Object[]getEntities()Get entitiesjava.lang.ObjectgetEntity(int n)Get an entity.inthashCode()Compute the hashcode of the tuple.static voidmain(java.lang.String[] args)intsize()Get the size.java.lang.StringtoString()Convert this tuple to a string representation.
 
- 
- 
- 
Constructor Detail- 
Tuplepublic Tuple(java.lang.Object entity1, java.lang.Object entity2)Convenience constructor for binary tuples.- Parameters:
- entity1- The first object in the tuple.
- entity2- The second object in the tuple.
 
 - 
Tuplepublic Tuple(java.lang.Object entity1, java.lang.Object entity2, java.lang.Object entity3)Convenience constructor for binary tuples.- Parameters:
- entity1- The first object in the tuple.
- entity2- The second object in the tuple.
- entity3- The third object in the tuple.
 
 - 
Tuplepublic Tuple(java.lang.Object[] entities) Create a new tuple.- Parameters:
- entities- The objects in the tuple.
 
 
- 
 - 
Method Detail- 
getEntitypublic java.lang.Object getEntity(int n) Get an entity.- Parameters:
- n- The entities position.
- Returns:
- The entity.
 
 - 
getEntitiespublic java.lang.Object[] getEntities() Get entities- Returns:
- The entities.
 
 - 
getpublic java.lang.Object get(int n) Get an entity.- Parameters:
- n- The entities position.
- Returns:
- The entity.
 
 - 
sizepublic int size() Get the size.- Returns:
- The size.
 
 - 
hashCodepublic int hashCode() Compute the hashcode of the tuple.- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) Test two tuples for equality.- Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() Convert this tuple to a string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- A string representation of this tuple.
 
 - 
clonepublic java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionClone this tuple.- Overrides:
- clonein class- java.lang.Object
- Returns:
- A shallow copy of this tuple.
- Throws:
- java.lang.CloneNotSupportedException
 
 - 
mainpublic static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 
- 
 
-