it.amattioli.dominate.properties
Class BoundCollectionDecorator<T>
java.lang.Object
java.util.AbstractCollection<T>
it.amattioli.dominate.properties.BoundCollectionDecorator<T>
- Type Parameters:
T -
- All Implemented Interfaces:
- Iterable<T>, Collection<T>
public class BoundCollectionDecorator<T>
- extends AbstractCollection<T>
A decorator for collections that fires an event every time the collection or one of its
elements is modified.
If a collection is decorated with this class when the add(Object) or AbstractCollection.remove(Object)
method is called a CollectionChangeEvent is fired and every CollectionChangeListener
registered using the addCollectionChangeListener(CollectionChangeListener) method is
notified. The same happens every time one of the elements of the collection fires a
PropertyChangeEvent.
- Author:
- andrea
| Methods inherited from class java.util.AbstractCollection |
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
BoundCollectionDecorator
public BoundCollectionDecorator(Collection<T> decorated)
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>- Specified by:
iterator in interface Collection<T>- Specified by:
iterator in class AbstractCollection<T>
add
public boolean add(T e)
- Specified by:
add in interface Collection<T>- Overrides:
add in class AbstractCollection<T>
size
public int size()
- Specified by:
size in interface Collection<T>- Specified by:
size in class AbstractCollection<T>
addCollectionChangeListener
public void addCollectionChangeListener(CollectionChangeListener listener)
removeCollectionChangeListener
public void removeCollectionChangeListener(CollectionChangeListener listener)
Copyright © 2011. All Rights Reserved.