at.dms.util
Class ConstList

java.lang.Object
  extended by at.dms.util.ConstList
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
MutableList

public class ConstList
extends Object
implements Serializable, Cloneable

This provides a constant interface to a list, where "constant" means that elements can't be added or removed from the list. They can, however, be set to different elements.

See Also:
Serialized Form

Field Summary
protected  LinkedList<Object> list
           
 
Constructor Summary
ConstList()
           
ConstList(LinkedList<Object> list)
           
 
Method Summary
 Object clone()
           
 boolean contains(Object o)
          Returns true if this list contains the specified element.
 boolean containsAll(Collection c)
          Returns true if this list contains all of the elements of the specified collection.
 boolean equals(Object o)
          Compares the specified object with this list for equality.
 Object get(int index)
          Returns the element at the specified position in this list.
 int hashCode()
          Returns the hash code value for this list.
 int indexOf(Object o)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
 boolean isEmpty()
          Returns true if this list contains no elements.
 Iterator<Object> iterator()
          Returns an iterator over the elements in this list in proper sequence.
 int lastIndexOf(Object o)
          Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
 ListIterator<Object> listIterator()
          Returns a list iterator of the elements in this list (in proper sequence).
 ListIterator<Object> listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
 Object set(int index, Object element)
          Replaces the element at the specified position in this list with the specified element (optional operation).
 int size()
          Returns the number of elements in this list.
 Object[] toArray()
          Returns an array containing all of the elements in this list in proper sequence.
 Object[] toArray(Object[] a)
          Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected LinkedList<Object> list
Constructor Detail

ConstList

public ConstList()

ConstList

public ConstList(LinkedList<Object> list)
Method Detail

contains

public boolean contains(Object o)
Returns true if this list contains the specified element.


containsAll

public boolean containsAll(Collection c)
Returns true if this list contains all of the elements of the specified collection.


equals

public boolean equals(Object o)
Compares the specified object with this list for equality.

Overrides:
equals in class Object

get

public Object get(int index)
Returns the element at the specified position in this list.


hashCode

public int hashCode()
Returns the hash code value for this list.

Overrides:
hashCode in class Object

indexOf

public int indexOf(Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.


isEmpty

public boolean isEmpty()
Returns true if this list contains no elements.


iterator

public Iterator<Object> iterator()
Returns an iterator over the elements in this list in proper sequence.


lastIndexOf

public int lastIndexOf(Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.


listIterator

public ListIterator<Object> listIterator()
Returns a list iterator of the elements in this list (in proper sequence).


listIterator

public ListIterator<Object> listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.


set

public Object set(int index,
                  Object element)
Replaces the element at the specified position in this list with the specified element (optional operation).


size

public int size()
Returns the number of elements in this list.


toArray

public Object[] toArray()
Returns an array containing all of the elements in this list in proper sequence.


toArray

public Object[] toArray(Object[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.


clone

public Object clone()
Overrides:
clone in class Object