org.metasyntactic.math
Class Tuple

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--org.metasyntactic.math.Tuple
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable
Direct Known Subclasses:
Edge

public class Tuple
extends java.util.ArrayList

In languages, a data object containing two or more components. Also known as a product type or pair, triple, quad, etc. Tuples of different sizes have different types, in contrast to lists where the type is independent of the length. The components of a tuple may be of different types whereas all elements of a list have the same type. Examples of tuples - in standard notation - are <1,2>, <"Tuple",True>, ,z>. The degenerate tuple with zero components, written <>, is known as the unit type since it has only one possible value which is also written <>.

See Also:
Serialized Form

Field Summary
protected  int cachedHash
           
protected  int oldModCount
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Tuple()
           
Tuple(java.util.Collection c)
           
Tuple(int initialSize)
           
Tuple(java.lang.Object[] elements)
           
 
Method Summary
 int hashCode()
           
 int order()
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Field Detail

oldModCount

protected int oldModCount

cachedHash

protected int cachedHash
Constructor Detail

Tuple

public Tuple()

Tuple

public Tuple(int initialSize)

Tuple

public Tuple(java.util.Collection c)

Tuple

public Tuple(java.lang.Object[] elements)
Method Detail

order

public int order()

toString

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

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.util.AbstractList