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

java.lang.Object
  extended by org.dishevelled.observable.AbstractListDecorator<E>
      extended by org.dishevelled.observable.AbstractObservableList<E>
          extended by org.dishevelled.observable.impl.ObservableListImpl<E>
Type Parameters:
E - list element type
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, ObservableList<E>

public class ObservableListImpl<E>
extends AbstractObservableList<E>

Observable list decorator that fires empty vetoable list change events in preXxx methods and empty list change events in postXxx methods. Observable list 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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dishevelled.observable.AbstractObservableList
AbstractObservableList.ObservableSubList
 
Constructor Summary
ObservableListImpl(List<E> list)
          Create a new observable decorator for the specified list.
 
Method Summary
protected  void postAdd(E e)
          Notify subclasses the add method has just been called on the wrapped list with the specified parameter.
protected  void postAddAll(Collection<? extends E> coll)
          Notify subclasses the addAll method has just been called on the wrapped list with the specified parameter.
protected  void postAddAllAtIndex(int index, Collection<? extends E> coll)
          Notify subclasses the addAll(int, Collection) method has just been called on the wrapped list with the specified parameters.
protected  void postAddAtIndex(int index, E e)
          Notify subclasses the add(int, E) method has just been called on the wrapped list with the specified parameters.
protected  void postClear()
          Notify subclasses the clear method has just been called on the wrapped list.
protected  void postIteratorRemove()
          Notify subclasses the remove method has just been called on the wrapped list's iterator.
protected  void postListIteratorRemove()
          Notify subclasses the remove method has just been called on the wrapped list's list iterator.
protected  void postListIteratorSet()
          Notify subclasses the set method has just been called on the wrapped list's list iterator.
protected  void postRemove(Object o)
          Notify subclasses the remove method has just been called on the wrapped list with the specified parameter.
protected  void postRemoveAll(Collection<?> coll)
          Notify subclasses the removeAll method has just been called on the wrapped list with the specified parameter.
protected  void postRemoveIndex(int index)
          Notify subclasses the remove(int) method has just been called on the wrapped list with the specified parameter.
protected  void postRetainAll(Collection<?> coll)
          Notify subclasses the retainAll method has just been called on the wrapped list with the specified parameter.
protected  void postSet(int index, E e)
          Notify subclasses the set method has just been called on the wrapped list with the specified parameters.
protected  boolean preAdd(E e)
          Notify subclasses the add method is about to be called on the wrapped list with the specified parameter.
protected  boolean preAddAll(Collection<? extends E> coll)
          Notify subclasses the addAll method is about to be called on the wrapped list with the specified parameter.
protected  boolean preAddAllAtIndex(int index, Collection<? extends E> coll)
          Notify subclasses the addAll(int, Collection) method is about to be called on the wrapped list with the specified parameters.
protected  boolean preAddAtIndex(int index, E e)
          Notify subclasses the add(int, E) method is about to be called on the wrapped list with the specified parameters.
protected  boolean preClear()
          Notify subclasses the clear method is about to be called on the wrapped list.
protected  boolean preIteratorRemove()
          Notify subclasses the remove method is about to be called on the wrapped list's iterator.
protected  boolean preListIteratorRemove()
          Notify subclasses the remove method is about to be called on the wrapped list's list iterator.
protected  boolean preListIteratorSet()
          Notify subclasses the set method is about to be called on the wrapped list's list iterator.
protected  boolean preRemove(Object o)
          Notify subclasses the remove method is about to be called on the wrapped list with the specified parameter.
protected  boolean preRemoveAll(Collection<?> coll)
          Notify subclasses the removeAll method is about to be called on the wrapped list with the specified parameter.
protected  boolean preRemoveIndex(int index)
          Notify subclasses the remove(int) method is about to be called on the wrapped list with the specified parameter.
protected  boolean preRetainAll(Collection<?> coll)
          Notify subclasses the retainAll method is about to be called on the wrapped list with the specified parameter.
protected  boolean preSet(int index, E e)
          Notify subclasses the set method is about to be called on the wrapped list with the specified parameters.
 
Methods inherited from class org.dishevelled.observable.AbstractObservableList
add, add, addAll, addAll, addListChangeListener, addVetoableListChangeListener, clear, fireListChanged, fireListChanged, fireListWillChange, fireListWillChange, getListChangeListenerCount, getListChangeListeners, getObservableListChangeSupport, getVetoableListChangeListenerCount, getVetoableListChangeListeners, iterator, listIterator, listIterator, remove, remove, removeAll, removeListChangeListener, removeVetoableListChangeListener, retainAll, set, subList
 
Methods inherited from class org.dishevelled.observable.AbstractListDecorator
contains, containsAll, equals, get, getList, hashCode, indexOf, isEmpty, lastIndexOf, 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.List
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, lastIndexOf, size, toArray, toArray
 

Constructor Detail

ObservableListImpl

public ObservableListImpl(List<E> list)
Create a new observable decorator for the specified list.

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

Specified by:
preAdd in class AbstractObservableList<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 list with the specified parameter.

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

preAddAtIndex

protected boolean preAddAtIndex(int index,
                                E e)
Notify subclasses the add(int, E) method is about to be called on the wrapped list with the specified parameters. Return true to proceed with the change.

Specified by:
preAddAtIndex in class AbstractObservableList<E>
Parameters:
index - add(int, E) method index parameter
e - add(int, E) method e parameter
Returns:
true to proceed with the change

postAddAtIndex

protected void postAddAtIndex(int index,
                              E e)
Notify subclasses the add(int, E) method has just been called on the wrapped list with the specified parameters.

Specified by:
postAddAtIndex in class AbstractObservableList<E>
Parameters:
index - add(int, E) method index parameter
e - add(int, E) method e parameter

preAddAll

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

Specified by:
preAddAll in class AbstractObservableList<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 list with the specified parameter.

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

preAddAllAtIndex

protected boolean preAddAllAtIndex(int index,
                                   Collection<? extends E> coll)
Notify subclasses the addAll(int, Collection) method is about to be called on the wrapped list with the specified parameters. Return true to proceed with the change.

Specified by:
preAddAllAtIndex in class AbstractObservableList<E>
Parameters:
index - addAll(int, Collection) method index parameter
coll - addAll(int, Collection) method coll parameter
Returns:
true to proceed with the change

postAddAllAtIndex

protected void postAddAllAtIndex(int index,
                                 Collection<? extends E> coll)
Notify subclasses the addAll(int, Collection) method has just been called on the wrapped list with the specified parameters.

Specified by:
postAddAllAtIndex in class AbstractObservableList<E>
Parameters:
index - addAll(int, Collection) method index parameter
coll - addAll(int, Collection) method coll parameter

preSet

protected boolean preSet(int index,
                         E e)
Notify subclasses the set method is about to be called on the wrapped list with the specified parameters. Return true to proceed with the change.

Specified by:
preSet in class AbstractObservableList<E>
Parameters:
index - set method index parameter
e - set method e parameter
Returns:
true to proceed with the change

postSet

protected void postSet(int index,
                       E e)
Notify subclasses the set method has just been called on the wrapped list with the specified parameters.

Specified by:
postSet in class AbstractObservableList<E>
Parameters:
index - set method index parameter
e - set method e parameter

preClear

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

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

postClear

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

Specified by:
postClear in class AbstractObservableList<E>

preRemoveIndex

protected boolean preRemoveIndex(int index)
Notify subclasses the remove(int) method is about to be called on the wrapped list with the specified parameter. Return true to proceed with the change.

Specified by:
preRemoveIndex in class AbstractObservableList<E>
Parameters:
index - remove(int) method parameter
Returns:
true to proceed with the change

postRemoveIndex

protected void postRemoveIndex(int index)
Notify subclasses the remove(int) method has just been called on the wrapped list with the specified parameter.

Specified by:
postRemoveIndex in class AbstractObservableList<E>
Parameters:
index - remove(int) method parameter

preRemove

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

Specified by:
preRemove in class AbstractObservableList<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 list with the specified parameter.

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

Specified by:
preRemoveAll in class AbstractObservableList<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 list with the specified parameter.

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

Specified by:
preRetainAll in class AbstractObservableList<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 list with the specified parameter.

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

preIteratorRemove

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

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

postIteratorRemove

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

Specified by:
postIteratorRemove in class AbstractObservableList<E>

preListIteratorRemove

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

Specified by:
preListIteratorRemove in class AbstractObservableList<E>
Returns:
true to proceed with the change

postListIteratorRemove

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

Specified by:
postListIteratorRemove in class AbstractObservableList<E>

preListIteratorSet

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

Specified by:
preListIteratorSet in class AbstractObservableList<E>
Returns:
true to proceed with the change

postListIteratorSet

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

Specified by:
postListIteratorSet in class AbstractObservableList<E>


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