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

java.lang.Object
  extended by org.dishevelled.observable.AbstractSortedSetDecorator<E>
      extended by org.dishevelled.observable.AbstractObservableSortedSet<E>
          extended by org.dishevelled.observable.impl.ObservableSortedSetImpl<E>
Type Parameters:
E - sorted set element type
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, SortedSet<E>, ObservableSortedSet<E>

public class ObservableSortedSetImpl<E>
extends AbstractObservableSortedSet<E>

Observable sorted set decorator that fires empty vetoable sorted set change events in preXxx methods and empty sorted set change events in postXxx methods. Observable sorted 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
ObservableSortedSetImpl(SortedSet<E> sortedSet)
          Create a new observable decorator for the specified sorted set.
 
Method Summary
protected  void postAdd(E e)
          Notify subclasses the add method has just been called on the wrapped sorted set with the specified parameter.
protected  void postAddAll(Collection<? extends E> coll)
          Notify subclasses the addAll method has just been called on the wrapped sorted set with the specified parameter.
protected  void postClear()
          Notify subclasses the clear method has just been called on the wrapped sorted set.
protected  void postIteratorRemove()
          Notify subclasses the remove method has just been called on the wrapped sorted set's iterator.
protected  void postRemove(Object o)
          Notify subclasses the remove method has just been called on the wrapped sorted set with the specified parameter.
protected  void postRemoveAll(Collection<?> coll)
          Notify subclasses the removeAll method has just been called on the wrapped sorted set with the specified parameter.
protected  void postRetainAll(Collection<?> coll)
          Notify subclasses the retainAll method has just been called on the wrapped sorted set with the specified parameter.
protected  boolean preAdd(E e)
          Notify subclasses the add method is about to be called on the wrapped sorted 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 sorted set with the specified parameter.
protected  boolean preClear()
          Notify subclasses the clear method is about to be called on the wrapped sorted set.
protected  boolean preIteratorRemove()
          Notify subclasses the remove method is about to be called on the wrapped sorted set's iterator.
protected  boolean preRemove(Object o)
          Notify subclasses the remove method is about to be called on the wrapped sorted set with the specified parameter.
protected  boolean preRemoveAll(Collection<?> coll)
          Notify subclasses the removeAll method is about to be called on the wrapped sorted set with the specified parameter.
protected  boolean preRetainAll(Collection<?> coll)
          Notify subclasses the retainAll method is about to be called on the wrapped sorted set with the specified parameter.
 
Methods inherited from class org.dishevelled.observable.AbstractObservableSortedSet
add, addAll, addSortedSetChangeListener, addVetoableSortedSetChangeListener, clear, fireSortedSetChanged, fireSortedSetChanged, fireSortedSetWillChange, fireSortedSetWillChange, getObservableSortedSetChangeSupport, getSortedSetChangeListenerCount, getSortedSetChangeListeners, getVetoableSortedSetChangeListenerCount, getVetoableSortedSetChangeListeners, iterator, remove, removeAll, removeSortedSetChangeListener, removeVetoableSortedSetChangeListener, retainAll
 
Methods inherited from class org.dishevelled.observable.AbstractSortedSetDecorator
comparator, contains, containsAll, equals, first, getSortedSet, hashCode, headSet, isEmpty, last, size, subSet, tailSet, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.SortedSet
comparator, first, headSet, last, subSet, tailSet
 
Methods inherited from interface java.util.Set
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
 

Constructor Detail

ObservableSortedSetImpl

public ObservableSortedSetImpl(SortedSet<E> sortedSet)
Create a new observable decorator for the specified sorted set.

Parameters:
sortedSet - sorted 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 sorted set with the specified parameter. Return true to proceed with the change.

Specified by:
preAdd in class AbstractObservableSortedSet<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 sorted set with the specified parameter.

Specified by:
postAdd in class AbstractObservableSortedSet<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 sorted set with the specified parameter. Return true to proceed with the change.

Specified by:
preAddAll in class AbstractObservableSortedSet<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 sorted set with the specified parameter.

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

preClear

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

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

postClear

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

Specified by:
postClear in class AbstractObservableSortedSet<E>

preRemove

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

Specified by:
preRemove in class AbstractObservableSortedSet<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 sorted set with the specified parameter.

Specified by:
postRemove in class AbstractObservableSortedSet<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 sorted set with the specified parameter. Return true to proceed with the change.

Specified by:
preRemoveAll in class AbstractObservableSortedSet<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 sorted set with the specified parameter.

Specified by:
postRemoveAll in class AbstractObservableSortedSet<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 sorted set with the specified parameter. Return true to proceed with the change.

Specified by:
preRetainAll in class AbstractObservableSortedSet<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 sorted set with the specified parameter.

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

preIteratorRemove

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

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

postIteratorRemove

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

Specified by:
postIteratorRemove in class AbstractObservableSortedSet<E>


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