|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.event.ListenerSupport
This is an utility class that can be used by beans that need support for handling listeners and firing events. You can use an subclass of this class as a member field of your bean and delegate work to it. It handles the work for a listener support subclass managing the Vector of listeners. It knows nothing about firing events to the listeners.
Field Summary | |
protected java.util.Vector |
listeners
|
protected java.lang.Object |
source
|
Constructor Summary | |
ListenerSupport(java.lang.Object sourceBean)
Construct a ListenerSupport object. |
Method Summary | |
void |
addListener(java.lang.Object listener)
Add an Object to the listener list. |
java.util.List |
getListeners()
Return a cloned list of Listeners. |
protected java.lang.Object |
getSource()
Get the source of the events. |
java.util.Iterator |
iterator()
Return an iterator over a clone of the listeners. |
void |
readObject(java.io.ObjectInputStream s)
Read the listeners from a stream. |
void |
removeAll()
Clear the listener list. |
void |
removeListener(java.lang.Object obj)
Remove an Object from the listener list. |
protected void |
setSource(java.lang.Object src)
Set the source of the events. |
int |
size()
Return the number of listeners. |
void |
writeObject(java.io.ObjectOutputStream s)
Write the listeners to a stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient java.util.Vector listeners
protected java.lang.Object source
Constructor Detail |
public ListenerSupport(java.lang.Object sourceBean)
sourceBean
- The bean to be given as the source for any
events.Method Detail |
protected void setSource(java.lang.Object src)
protected java.lang.Object getSource()
public void addListener(java.lang.Object listener)
listener
- The listener object to be addedpublic void removeListener(java.lang.Object obj)
obj
- The Object to be removedpublic void removeAll()
public java.util.Iterator iterator()
public int size()
public java.util.List getListeners()
public void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
java.io.IOException
public void readObject(java.io.ObjectInputStream s) throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |