gnu.crypto.util

Class 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.

Version: $Revision: 1.2 $

Constructor Summary
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()
Create the empty list.
SimpleList(Collection c)
Create an n-tuple of arbitrary size.
Method Summary
Objectget(int index)
intsize()
StringtoString()

Constructor Detail

SimpleList

public SimpleList(Object element)
Create a singleton list.

Parameters: e1 The first element.

SimpleList

public SimpleList(Object e1, Object e2)
Create an ordered pair (2-tuple).

Parameters: e1 The first element. e2 The second element.

SimpleList

public SimpleList(Object e1, Object e2, Object e3)
Create a 3-tuple.

Parameters: 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.

Parameters: e1 The first element. e2 The second element. e3 The third element. e4 The fourth element.

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.

Parameters: c The collection.

Method Detail

get

public Object get(int index)

size

public int size()

toString

public String toString()
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.