jbcl.model Package
java.lang.Object +----com.borland.jbcl.model.SingletonModelMulticaster
Properties Methods
Implements SingletonModelListener, EventListener
A component that dispatches singleton-model events to multiple listeners. SingletonModelMulticaster
maintains an array of listeners. The add()
, remove()
, and find()
methods are used to manage this list.
The hasListeners()
method determines whether any objects are listening for singleton-model events. The dispatch()
method sends a singleton-model event to all listeners.
A SingletonModelMulticaster
is not required to synchronize its access of the array of listeners because all changes are made to a copy of the original list.
public final synchronized void add(SingletonModelListener listener)Adds an object to the array of listeners.
Parameters:
listener
public final void dispatch(SingletonModelEvent e)Sends a singleton-model event to all listeners. This is a high-speed dispatcher that does not need to be synchronized. If a singleton-model event occurs, it calls the
modelContentChanged()
method of the singleton-model listeners.
Parameters:
e
public int find(SingletonModelListener listener)Searches for the specified listener among the array of listening objects.
Parameters:
listener
public final boolean hasListeners()Determines if there are any listeners for singleton-model events. If the method returns true, one or more listeners are present.
public final synchronized void remove(SingletonModelListener listener)Removes the specified listening object from the array of listeners for singleton-model events.
Parameters:
listener