org.dishevelled.observable.event
Class ObservableSortedSetChangeSupport<E>

java.lang.Object
  extended by org.dishevelled.observable.event.ObservableSortedSetChangeSupport<E>
Type Parameters:
E - sorted set element type
All Implemented Interfaces:
Serializable

public class ObservableSortedSetChangeSupport<E>
extends Object
implements Serializable

A support class that can be used via delegation to provide SortedSetChangeListener and VetoableSortedSetChangeListener management.

Version:
$Revision$ $Date$
Author:
Michael Heuer
See Also:
Serialized Form

Constructor Summary
protected ObservableSortedSetChangeSupport()
          Create a new support class meant to be subclassed.
  ObservableSortedSetChangeSupport(ObservableSortedSet<E> source)
          Create a new support class that fires sorted set change and vetoable sorted set change events with the specified source as the source of the events.
 
Method Summary
 void addSortedSetChangeListener(SortedSetChangeListener<E> l)
          Add the specified sorted set change listener.
 void addVetoableSortedSetChangeListener(VetoableSortedSetChangeListener<E> l)
          Add the specified vetoable sorted set change listener.
 void fireSortedSetChanged()
          Fire a change event to all registered SortedSetChangeListeners.
 void fireSortedSetChanged(SortedSetChangeEvent<E> e)
          Fire the specified change event to all registered SortedSetChangeListeners.
 void fireSortedSetWillChange()
          Fire a will change event to all registered VetoableSortedSetChangeListeners.
 void fireSortedSetWillChange(VetoableSortedSetChangeEvent<E> e)
          Fire the specified will change event to all registered VetoableSortedSetChangeListeners.
protected  EventListenerList getEventListenerList()
          Return the EventListenerList backing this observable sorted set support class.
 int getSortedSetChangeListenerCount()
          Return the number of SortedSetChangeListeners registered to this observable sorted set support class.
 SortedSetChangeListener<E>[] getSortedSetChangeListeners()
          Return an array of all SortedSetChangeListeners, or an empty array if none are registered.
 int getVetoableSortedSetChangeListenerCount()
          Return the number of VetoableSortedSetChangeListeners registered to this observable sorted set support class.
 VetoableSortedSetChangeListener<E>[] getVetoableSortedSetChangeListeners()
          Return an array of all VetoableSortedSetChangeListeners, or an empty array if none are registered.
 void removeSortedSetChangeListener(SortedSetChangeListener<E> l)
          Remove the specified sorted set change listener.
 void removeVetoableSortedSetChangeListener(VetoableSortedSetChangeListener<E> l)
          Remove the specified vetoable sorted set change listener.
protected  void setSource(ObservableSortedSet<E> source)
          Set the source of sorted set change and vetoable sorted set change events to source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservableSortedSetChangeSupport

protected ObservableSortedSetChangeSupport()
Create a new support class meant to be subclassed.


ObservableSortedSetChangeSupport

public ObservableSortedSetChangeSupport(ObservableSortedSet<E> source)
Create a new support class that fires sorted set change and vetoable sorted set change events with the specified source as the source of the events.

Parameters:
source - the event source
Method Detail

setSource

protected void setSource(ObservableSortedSet<E> source)
Set the source of sorted set change and vetoable sorted set change events to source. Subclasses should call this method before any of the fireX methods.

Parameters:
source - the event source

getEventListenerList

protected final EventListenerList getEventListenerList()
Return the EventListenerList backing this observable sorted set support class.

Returns:
the EventListenerList backing this observable sorted set support class.

addSortedSetChangeListener

public final void addSortedSetChangeListener(SortedSetChangeListener<E> l)
Add the specified sorted set change listener.

Parameters:
l - sorted set change listener to add

removeSortedSetChangeListener

public final void removeSortedSetChangeListener(SortedSetChangeListener<E> l)
Remove the specified sorted set change listener.

Parameters:
l - sorted set change listener to remove

addVetoableSortedSetChangeListener

public final void addVetoableSortedSetChangeListener(VetoableSortedSetChangeListener<E> l)
Add the specified vetoable sorted set change listener.

Parameters:
l - vetoable sorted set change listener to add

removeVetoableSortedSetChangeListener

public final void removeVetoableSortedSetChangeListener(VetoableSortedSetChangeListener<E> l)
Remove the specified vetoable sorted set change listener.

Parameters:
l - vetoable sorted set change listener to remove

getSortedSetChangeListeners

public final SortedSetChangeListener<E>[] getSortedSetChangeListeners()
Return an array of all SortedSetChangeListeners, or an empty array if none are registered.

Returns:
an array of all SortedSetChangeListeners, or an empty array if none are registered

getSortedSetChangeListenerCount

public final int getSortedSetChangeListenerCount()
Return the number of SortedSetChangeListeners registered to this observable sorted set support class.

Returns:
the number of SortedSetChangeListeners registered to this observable sorted set support class

getVetoableSortedSetChangeListeners

public final VetoableSortedSetChangeListener<E>[] getVetoableSortedSetChangeListeners()
Return an array of all VetoableSortedSetChangeListeners, or an empty array if none are registered.

Returns:
an array of all VetoableSortedSetChangeListeners, or an empty array if none are registered

getVetoableSortedSetChangeListenerCount

public final int getVetoableSortedSetChangeListenerCount()
Return the number of VetoableSortedSetChangeListeners registered to this observable sorted set support class.

Returns:
the number of VetoableSortedSetChangeListeners registered to this observable sorted set support class

fireSortedSetWillChange

public void fireSortedSetWillChange()
                             throws SortedSetChangeVetoException
Fire a will change event to all registered VetoableSortedSetChangeListeners.

Throws:
SortedSetChangeVetoException - if any of the listeners veto the change

fireSortedSetWillChange

public void fireSortedSetWillChange(VetoableSortedSetChangeEvent<E> e)
                             throws SortedSetChangeVetoException
Fire the specified will change event to all registered VetoableSortedSetChangeListeners.

Parameters:
e - will change event
Throws:
SortedSetChangeVetoException - if any of the listeners veto the change

fireSortedSetChanged

public void fireSortedSetChanged()
Fire a change event to all registered SortedSetChangeListeners.


fireSortedSetChanged

public void fireSortedSetChanged(SortedSetChangeEvent<E> e)
Fire the specified change event to all registered SortedSetChangeListeners.

Parameters:
e - change event


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