at.dms.util
Class MutableList

java.lang.Object
  extended by at.dms.util.ConstList
      extended by at.dms.util.MutableList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List

public class MutableList
extends ConstList
implements List, Cloneable, Serializable

Intended to be used in conjunction with ConstList, if one user wants a constant view of a list while another wants to be able to mutate it.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class at.dms.util.ConstList
list
 
Constructor Summary
MutableList()
           
 
Method Summary
 void add(int index, Object element)
          Inserts the specified element at the specified position in this list (optional operation).
 boolean add(Object o)
          Appends the specified element to the end of this list (optional operation).
 boolean addAll(Collection c)
          Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
 boolean addAll(int index, Collection c)
          Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
 void clear()
          Removes all of the elements from this list (optional operation).
 Object clone()
           
 Object remove(int index)
          Removes the element at the specified position in this list (optional operation).
 boolean remove(Object o)
          Removes the first occurrence in this list of the specified element (optional operation).
 boolean removeAll(Collection c)
          Removes from this list all the elements that are contained in the specified collection (optional operation).
 boolean retainAll(Collection c)
          Retains only the elements in this list that are contained in the specified collection (optional operation).
 List<Object> subList(int fromIndex, int toIndex)
          Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
 
Methods inherited from class at.dms.util.ConstList
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, set, size, toArray, toArray
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, set, size, toArray, toArray
 

Constructor Detail

MutableList

public MutableList()
Method Detail

add

public void add(int index,
                Object element)
Inserts the specified element at the specified position in this list (optional operation).

Specified by:
add in interface List

add

public boolean add(Object o)
Appends the specified element to the end of this list (optional operation).

Specified by:
add in interface Collection
Specified by:
add in interface List

addAll

public boolean addAll(Collection c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

Specified by:
addAll in interface Collection
Specified by:
addAll in interface List

addAll

public boolean addAll(int index,
                      Collection c)
Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

Specified by:
addAll in interface List

clear

public void clear()
Removes all of the elements from this list (optional operation).

Specified by:
clear in interface Collection
Specified by:
clear in interface List

remove

public Object remove(int index)
Removes the element at the specified position in this list (optional operation).

Specified by:
remove in interface List

remove

public boolean remove(Object o)
Removes the first occurrence in this list of the specified element (optional operation).

Specified by:
remove in interface Collection
Specified by:
remove in interface List

removeAll

public boolean removeAll(Collection c)
Removes from this list all the elements that are contained in the specified collection (optional operation).

Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List

retainAll

public boolean retainAll(Collection c)
Retains only the elements in this list that are contained in the specified collection (optional operation).

Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List

subList

public List<Object> subList(int fromIndex,
                            int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

Specified by:
subList in interface List

clone

public Object clone()
Overrides:
clone in class ConstList