borland Packages Class Hierarchy jb.util Package
java.lang.Object +----com.borland.jb.util.EventMulticaster
Variables Properties Methods
EventMulticaster is a multicaster for all user-defined events. All events, such as model and selection events, use EventMulticaster, which sends an event to all listeners. EventMulticaster maintains an array of listeners. The add(), remove(), and find() methods maintain this list.
The hasListeners() method determines whether any objects are listening for events. EventMulticaster has a dispatch() method and two specialized dispatch methods: exceptionDispatch(), which is used for events that can throw exceptions, and vetoableDispatch(), which is used for events that can decline an event.
protected transient EventListener[]listeners
The array of action listeners.
public int getListenerCount()Returns the number of event listeners in the array of listeners.
public static final EventMulticaster add(EventMulticaster caster, EventListener listener)Adds an object to the array of listeners. It is used for efficiency to avoid allocating an EventMulticaster until there are listeners. The allocated EventMulticaster can be tested for null to see if there are any listeners, thereby improving efficiency again.
public final synchronized void add(EventListener listener)Adds an object to the array of listeners.
public final void dispatch(DispatchableEvent e)Sends a DispatchableEvent to all listeners. This method is a high-speed dispatcher that does not need to be synchronized.
public final void exceptionDispatch(ExceptionDispatch e)Sends an ExceptionDispatch event to all listeners. It is used for all events that can throw exceptions. This method is a high-speed dispatcher that does not need to be synchronized.
public int find(EventListener listener)Searches for the specified listener among the array of listening objects.
public final boolean hasListeners()Determines if there are any listeners for events. If the method returns true, one or more event listeners are present.
public static final EventMulticaster remove(EventMulticaster caster, EventListener listener)Removes the specified listening object from the array of event listeners. This remove() method is the counterpart of the the add() method that allocates an event multicaster and improves efficiency.
public final synchronized void remove(EventListener listener)Removes the specified listening object from the array of event listeners.
public final boolean vetoableDispatch(VetoableDispatch e)Sends a VetoableDispatch event to all listeners. It is used for all events that can throw VetoException and therefore decline the event. This method is a high-speed dispatcher that does not need to be synchronized.
vetoableDispatch() returns false if an event listener throws a VetoException. A return value of true indicates the listener accepted the event.