JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util
Class JCListenerList

java.lang.Object
  |
  +--com.klg.jclass.util.JCListenerList
All Implemented Interfaces:
Serializable

public class JCListenerList
extends Object
implements Serializable

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.

See Also:
Serialized Form

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

next

protected com.klg.jclass.util.JCListenerList next

listener

protected Object listener
Method Detail

add

public static com.klg.jclass.util.JCListenerList add(com.klg.jclass.util.JCListenerList list,
                                                     Object newListener)

remove

public static com.klg.jclass.util.JCListenerList remove(com.klg.jclass.util.JCListenerList list,
                                                        Object oldListener)

elements

public static Enumeration elements(com.klg.jclass.util.JCListenerList list)

Copyright © 2004 Quest Software Inc..
All rights reserved.