|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.JCListenerList
JCListenerList
is a class that assists with
keeping track of event listeners in a thread-safe manner.
To add a listener using a JCListenerList
:
JCListenerList someList = null; ... public synchronized void addSomeListener(SomeListener l) { someList = JCListenerList.add(someList, l); }
To remove a listener:
public synchronized void removeSomeListener(SomeListener l) { someList = JCListenerList.remove(someList, l); }
The use of static methods on the JCListenerList
class prevents any
problems from occurring if the list being modified is null.
To send events to the listener in the list, simply get the
Enumeration
of the list and walk through the elements.
There is no ordering guarantee.
Field Summary | |
protected Object |
listener
|
protected com.klg.jclass.util.JCListenerList |
next
|
Method Summary | |
static com.klg.jclass.util.JCListenerList |
add(com.klg.jclass.util.JCListenerList list,
Object newListener)
|
static Enumeration |
elements(com.klg.jclass.util.JCListenerList list)
|
static com.klg.jclass.util.JCListenerList |
remove(com.klg.jclass.util.JCListenerList list,
Object oldListener)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected com.klg.jclass.util.JCListenerList next
protected Object listener
Method Detail |
public static com.klg.jclass.util.JCListenerList add(com.klg.jclass.util.JCListenerList list, Object newListener)
public static com.klg.jclass.util.JCListenerList remove(com.klg.jclass.util.JCListenerList list, Object oldListener)
public static Enumeration elements(com.klg.jclass.util.JCListenerList list)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |