dsto.dfc.collections
Class BasicMonitoredCollection
java.lang.Object
dsto.dfc.collections.BasicMonitoredCollection
- All Implemented Interfaces:
- MonitoredCollection, Copyable, Serializable, Cloneable, Iterable, Collection
- Direct Known Subclasses:
- BasicMonitoredList, BasicMonitoredSet
public class BasicMonitoredCollection
- extends Object
- implements MonitoredCollection, Serializable, Copyable
Basic implementation of MonitoredCollection that acts as a wrapper
around a Collection instance.
- Version:
- $Revision$
- See Also:
- Serialized Form
collection
protected Collection collection
collectionListeners
protected transient ArrayList collectionListeners
BasicMonitoredCollection
public BasicMonitoredCollection(Collection collection)
add
public boolean add(Object element)
- Specified by:
add
in interface Collection
remove
public boolean remove(Object element)
- Specified by:
remove
in interface Collection
addAll
public boolean addAll(Collection elements)
- Specified by:
addAll
in interface Collection
removeAll
public boolean removeAll(Collection elements)
- Specified by:
removeAll
in interface Collection
retainAll
public boolean retainAll(Collection elements)
- Specified by:
retainAll
in interface Collection
clear
public void clear()
- Specified by:
clear
in interface Collection
size
public int size()
- Specified by:
size
in interface Collection
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection
contains
public boolean contains(Object element)
- Specified by:
contains
in interface Collection
iterator
public Iterator iterator()
- Specified by:
iterator
in interface Iterable
- Specified by:
iterator
in interface Collection
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection
toArray
public Object[] toArray(Object[] array)
- Specified by:
toArray
in interface Collection
containsAll
public boolean containsAll(Collection elements)
- Specified by:
containsAll
in interface Collection
clone
public Object clone()
throws CloneNotSupportedException
- Description copied from interface:
Copyable
- Create a completely separate copy of this object and any mutable
objects owned by the object.
NOTE: subclasses should not remove the CloneNotSupportedException
throws clause if they themselves support subclassing:
removing the CloneNotSupportedException declaration stops
subclasses from indicating that a clone was not possible.
- Specified by:
clone
in interface Copyable
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
- if the clone failed or is not
possible.
emptyClone
protected BasicMonitoredCollection emptyClone()
throws CloneNotSupportedException
- Make an empty clone of this collection (ie a copy with none of the
original elements).
- Throws:
CloneNotSupportedException
removeCollectionListener
public void removeCollectionListener(CollectionListener l)
- Specified by:
removeCollectionListener
in interface MonitoredCollection
addCollectionListener
public void addCollectionListener(CollectionListener l)
- Specified by:
addCollectionListener
in interface MonitoredCollection
fireElementsAdded
protected void fireElementsAdded(CollectionEvent e)
fireElementsRemoved
protected void fireElementsRemoved(CollectionEvent e)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2008 Commonwealth of Australia