org.metastatic.jessie.provider
Class SimpleList
AbstractListorg.metastatic.jessie.provider.SimpleList
public final class SimpleList
extends AbstractList
A simple way to create immutable n-tuples. This class can be created with
up to four elements specified via one of the constructors, or with a
collection of arbitrary size.
SimpleList()- Create the empty list.
|
SimpleList(Collection c)- Create an n-tuple of arbitrary size.
|
SimpleList(Object element)- Create a singleton list.
|
SimpleList(Object e1, Object e2)- Create an ordered pair (2-tuple).
|
SimpleList(Object e1, Object e2, Object e3)- Create a 3-tuple.
|
SimpleList(Object e1, Object e2, Object e3, Object e4)- Create a 4-tuple.
|
SimpleList
public SimpleList()
Create the empty list.
SimpleList
public SimpleList(Collection c)
Create an n-tuple of arbitrary size. Even if the supplied collection has
no natural order, the created n-tuple will have the order that the
elements are returned by the collection's iterator.
SimpleList
public SimpleList(Object element)
Create a singleton list.
SimpleList
public SimpleList(Object e1,
Object e2) Create an ordered pair (2-tuple).
e1 - The first element.e2 - The second element.
SimpleList
public SimpleList(Object e1,
Object e2,
Object e3) Create a 3-tuple.
e1 - The first element.e2 - The second element.e3 - The third element.
SimpleList
public SimpleList(Object e1,
Object e2,
Object e3,
Object e4) Create a 4-tuple.
e1 - The first element.e2 - The second element.e3 - The third element.e4 - The fourth element.
get
public Object get(int index)
toString
public String toString()