borland Packages  Class Hierarchy  jbcl.model Package  Index 

SingletonModelMulticaster class

java.lang.Object
   +----borland.jbcl.model.SingletonModelMulticaster

About the SingletonModelMulticaster class

Properties  Methods  

Implements SingletonModelListener, EventListener

A class 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.


SingletonModelMulticaster properties

*Read-only properties **Write-only properties

Properties implemented in java.lang.Object

SingletonModelMulticaster methods

Methods implemented in this class

Methods implemented in java.lang.Object


SingletonModelMulticaster methods

add(borland.jbcl.model.SingletonModelListener)

  public final synchronized void add(borland.jbcl.model.SingletonModelListener listener)
Adds an object to the array of listeners.

Parameters:

listener
The object that is added to the list of listeners for singleton-model events.

dispatch(borland.jbcl.model.SingletonModelEvent)

  public final void dispatch(borland.jbcl.model.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
The singleton-model event object sent to all listeners.

find(borland.jbcl.model.SingletonModelListener)

  public int find(borland.jbcl.model.SingletonModelListener listener)
Searches for the specified listener among the array of listening objects.

Parameters:

listener
The object you are searching for in the list of listeners.

hasListeners()

  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.

remove(borland.jbcl.model.SingletonModelListener)

  public final synchronized void remove(borland.jbcl.model.SingletonModelListener listener)
Removes the specified listening object from the array of listeners for singleton-model events.

Parameters:

listener
The listening object that is removed from the array of listeners.