it.amattioli.dominate.properties
Class BoundCollectionDecorator<T>

Show UML class diagram
java.lang.Object
  extended by java.util.AbstractCollection<T>
      extended by 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

Constructor Summary
BoundCollectionDecorator(Collection<T> decorated)
           
 
Method Summary
 boolean add(T e)
           
 void addCollectionChangeListener(CollectionChangeListener listener)
           
 Iterator<T> iterator()
           
 void removeCollectionChangeListener(CollectionChangeListener listener)
           
 int size()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

BoundCollectionDecorator

public BoundCollectionDecorator(Collection<T> decorated)
Method Detail

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.