org.dishevelled.observable.impl
Class ObservableSetImpl<E>

java.lang.Object
  extended by org.dishevelled.observable.AbstractSetDecorator<E>
      extended by org.dishevelled.observable.AbstractObservableSet<E>
          extended by org.dishevelled.observable.impl.ObservableSetImpl<E>
Type Parameters:
E - set element type
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, ObservableSet<E>

public class ObservableSetImpl<E>
extends AbstractObservableSet<E>

Observable set decorator that fires empty vetoable set change events in preXxx methods and empty set change events in postXxx methods. Observable set listeners may query the source of the events to determine what may or may not have changed due to the event.

Version:
$Revision$ $Date$
Author:
Michael Heuer

Constructor Summary
ObservableSetImpl(Set<E> set)
          Create a new observable decorator for the specified set.
 
Method Summary
protected  void postAdd(E e)
          Notify subclasses the add method has just been called on the wrapped set with the specified parameter.
protected  void postAddAll(Collection<? extends E> coll)
          Notify subclasses the addAll method has just been called on the wrapped set with the specified parameter.
protected  void postClear()
          Notify subclasses the clear method has just been called on the wrapped set.
protected  void postIteratorRemove()
          Notify subclasses the remove method has just been called on the wrapped set's iterator.
protected  void postRemove(Object o)
          Notify subclasses the remove method has just been called on the wrapped set with the specified parameter.
protected  void postRemoveAll(Collection<?> coll)
          Notify subclasses the removeAll method has just been called on the wrapped set with the specified parameter.
protected  void postRetainAll(Collection<?> coll)
          Notify subclasses the retainAll method has just been called on the wrapped set with the specified parameter.
protected  boolean preAdd(E e)
          Notify subclasses the add method is about to be called on the wrapped set with the specified parameter.
protected  boolean preAddAll(Collection<? extends E> coll)
          Notify subclasses the addAll method is about to be called on the wrapped set with the specified parameter.
protected  boolean preClear()
          Notify subclasses the clear method is about to be called on the wrapped set.
protected  boolean preIteratorRemove()
          Notify subclasses the remove method is about to be called on the wrapped set's iterator.
protected  boolean preRemove(Object o)
          Notify subclasses the remove method is about to be called on the wrapped set with the specified parameter.
protected  boolean preRemoveAll(Collection<?> coll)
          Notify subclasses the removeAll method is about to be called on the wrapped set with the specified parameter.
protected  boolean preRetainAll(Collection<?> coll)
          Notify subclasses the retainAll method is about to be called on the wrapped set with the specified parameter.
 
Methods inherited from class org.dishevelled.observable.AbstractObservableSet
add, addAll, addSetChangeListener, addVetoableSetChangeListener, clear, fireSetChanged, fireSetChanged, fireSetWillChange, fireSetWillChange, getObservableSetChangeSupport, getSetChangeListenerCount, getSetChangeListeners, getVetoableSetChangeListenerCount, getVetoableSetChangeListeners, iterator, remove, removeAll, removeSetChangeListener, removeVetoableSetChangeListener, retainAll
 
Methods inherited from class org.dishevelled.observable.AbstractSetDecorator
contains, containsAll, equals, getSet, hashCode, isEmpty, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
 

Constructor Detail

ObservableSetImpl

public ObservableSetImpl(Set<E> set)
Create a new observable decorator for the specified set.

Parameters:
set - set to decorate, must not be null
Method Detail

preAdd

protected boolean preAdd(E e)
Notify subclasses the add method is about to be called on the wrapped set with the specified parameter. Return true to proceed with the change.

Specified by:
preAdd in class AbstractObservableSet<E>
Parameters:
e - add method parameter
Returns:
true to proceed with the change

postAdd

protected void postAdd(E e)
Notify subclasses the add method has just been called on the wrapped set with the specified parameter.

Specified by:
postAdd in class AbstractObservableSet<E>
Parameters:
e - add method parameter

preAddAll

protected boolean preAddAll(Collection<? extends E> coll)
Notify subclasses the addAll method is about to be called on the wrapped set with the specified parameter. Return true to proceed with the change.

Specified by:
preAddAll in class AbstractObservableSet<E>
Parameters:
coll - addAll method parameter
Returns:
true to proceed with the change

postAddAll

protected void postAddAll(Collection<? extends E> coll)
Notify subclasses the addAll method has just been called on the wrapped set with the specified parameter.

Specified by:
postAddAll in class AbstractObservableSet<E>
Parameters:
coll - addAll method parameter

preClear

protected boolean preClear()
Notify subclasses the clear method is about to be called on the wrapped set. Return true to proceed with the change.

Specified by:
preClear in class AbstractObservableSet<E>
Returns:
true to proceed with the change

postClear

protected void postClear()
Notify subclasses the clear method has just been called on the wrapped set.

Specified by:
postClear in class AbstractObservableSet<E>

preRemove

protected boolean preRemove(Object o)
Notify subclasses the remove method is about to be called on the wrapped set with the specified parameter. Return true to proceed with the change.

Specified by:
preRemove in class AbstractObservableSet<E>
Parameters:
o - remove method parameter
Returns:
true to proceed with the change

postRemove

protected void postRemove(Object o)
Notify subclasses the remove method has just been called on the wrapped set with the specified parameter.

Specified by:
postRemove in class AbstractObservableSet<E>
Parameters:
o - remove method parameter

preRemoveAll

protected boolean preRemoveAll(Collection<?> coll)
Notify subclasses the removeAll method is about to be called on the wrapped set with the specified parameter. Return true to proceed with the change.

Specified by:
preRemoveAll in class AbstractObservableSet<E>
Parameters:
coll - removeAll method parameter
Returns:
true to proceed with the change

postRemoveAll

protected void postRemoveAll(Collection<?> coll)
Notify subclasses the removeAll method has just been called on the wrapped set with the specified parameter.

Specified by:
postRemoveAll in class AbstractObservableSet<E>
Parameters:
coll - removeAll method parameter

preRetainAll

protected boolean preRetainAll(Collection<?> coll)
Notify subclasses the retainAll method is about to be called on the wrapped set with the specified parameter. Return true to proceed with the change.

Specified by:
preRetainAll in class AbstractObservableSet<E>
Parameters:
coll - retainAll method parameter
Returns:
true to proceed with the change

postRetainAll

protected void postRetainAll(Collection<?> coll)
Notify subclasses the retainAll method has just been called on the wrapped set with the specified parameter.

Specified by:
postRetainAll in class AbstractObservableSet<E>
Parameters:
coll - retainAll method parameter

preIteratorRemove

protected boolean preIteratorRemove()
Notify subclasses the remove method is about to be called on the wrapped set's iterator. Return true to proceed with the change.

Specified by:
preIteratorRemove in class AbstractObservableSet<E>
Returns:
true to proceed with the change

postIteratorRemove

protected void postIteratorRemove()
Notify subclasses the remove method has just been called on the wrapped set's iterator.

Specified by:
postIteratorRemove in class AbstractObservableSet<E>


Copyright (c) 2003-2012 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).