dsto.dfc.collections
Class BasicMonitoredList

java.lang.Object
  extended by dsto.dfc.collections.BasicMonitoredCollection
      extended by dsto.dfc.collections.BasicMonitoredList
All Implemented Interfaces:
MonitoredCollection, MonitoredList, Copyable, Serializable, Cloneable, Iterable, Collection, List
Direct Known Subclasses:
DfcMonitoredList

public class BasicMonitoredList
extends BasicMonitoredCollection
implements MonitoredList, Copyable

Basic implementation of MonitoredList that acts as a wrapper around a List instance.

Version:
$Revision$
See Also:
Serialized Form

Nested Class Summary
protected  class BasicMonitoredList.ListIteratorWrapper
           
 
Nested classes/interfaces inherited from class dsto.dfc.collections.BasicMonitoredCollection
BasicMonitoredCollection.CollectionIteratorWrapper
 
Field Summary
 
Fields inherited from class dsto.dfc.collections.BasicMonitoredCollection
collection, collectionListeners
 
Constructor Summary
BasicMonitoredList()
          Default constructor: uses an ArrayList as backing list.
BasicMonitoredList(List list)
           
 
Method Summary
 void add(int index, Object object)
           
 boolean add(Object element)
           
 boolean addAll(Collection elements)
           
 boolean addAll(int index, Collection elements)
           
 void clear()
           
 Object get(int index)
           
 List getBackingList()
          Get the list backing this monitored list.
 int indexOf(Object object)
           
 int lastIndexOf(Object object)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int index)
           
 boolean remove(Object element)
           
 boolean removeAll(Collection elements)
           
 Object set(int index, Object element)
           
 List subList(int i1, int i2)
           
 
Methods inherited from class dsto.dfc.collections.BasicMonitoredCollection
addCollectionListener, clone, contains, containsAll, emptyClone, fireElementsAdded, fireElementsRemoved, isEmpty, iterator, removeCollectionListener, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface dsto.dfc.collections.MonitoredCollection
addCollectionListener, removeCollectionListener
 
Methods inherited from interface java.util.List
contains, containsAll, equals, hashCode, isEmpty, iterator, retainAll, size, toArray, toArray
 
Methods inherited from interface dsto.dfc.util.Copyable
clone
 

Constructor Detail

BasicMonitoredList

public BasicMonitoredList()
Default constructor: uses an ArrayList as backing list.


BasicMonitoredList

public BasicMonitoredList(List list)
Method Detail

getBackingList

public List getBackingList()
Get the list backing this monitored list. Be very careful in modifying this list, since any changes will not be seen by listeners.


add

public boolean add(Object element)
Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class BasicMonitoredCollection

remove

public boolean remove(Object element)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class BasicMonitoredCollection

addAll

public boolean addAll(Collection elements)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class BasicMonitoredCollection

removeAll

public boolean removeAll(Collection elements)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class BasicMonitoredCollection

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class BasicMonitoredCollection

get

public Object get(int index)
Specified by:
get in interface List

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List

add

public void add(int index,
                Object object)
Specified by:
add in interface List

addAll

public boolean addAll(int index,
                      Collection elements)
Specified by:
addAll in interface List

remove

public Object remove(int index)
Specified by:
remove in interface List

indexOf

public int indexOf(Object object)
Specified by:
indexOf in interface List

lastIndexOf

public int lastIndexOf(Object object)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List

subList

public List subList(int i1,
                    int i2)
Specified by:
subList in interface List


Copyright © 2008 Commonwealth of Australia