org.ceryle.util.event
Class EventSourceDelegate

java.lang.Object
  extended by org.ceryle.util.event.EventSourceDelegate
All Implemented Interfaces:
EventDelegate

public final class EventSourceDelegate
extends Object
implements EventDelegate

Delegating class that manages event listener registration and removal.

Alternately, rather than use this class you can have all events managed by the EventManager, which also provides an internal implementation of EventDelegate.

Author:
Murray Altheim

Constructor Summary
EventSourceDelegate()
           
 
Method Summary
 boolean addChangeListener(ChangeListener listener)
          Registers an ChangeListener with this instance.
 boolean isListening()
          Returns true if there are one or more listeners registered with this instance.
 boolean removeChangeListener(ChangeListener listener)
          Removes an ChangeListener from this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventSourceDelegate

public EventSourceDelegate()
Method Detail

addChangeListener

public final boolean addChangeListener(ChangeListener listener)
Registers an ChangeListener with this instance.

Specified by:
addChangeListener in interface EventDelegate
Parameters:
listener - the event listener
Returns:
true if the listener was added (i.e., it was not already in the list and was added)

removeChangeListener

public final boolean removeChangeListener(ChangeListener listener)
Removes an ChangeListener from this instance.

Specified by:
removeChangeListener in interface EventDelegate
Parameters:
listener - the event listener
Returns:
true if the listener was removed (i.e., it was actually in the list and was removed)

isListening

public boolean isListening()
Returns true if there are one or more listeners registered with this instance.

Specified by:
isListening in interface EventDelegate


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.