|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.lindfors.util.EventGeneratorSupport
public abstract class EventGeneratorSupport
Support class for objects implementing the
EventGenerator
interface.
Contains implementations for addListener, removeListener, and hasListeners.
Every effort has been made to try to achieve thread-safety in EventGeneratorSupport class. Of course, this doesn't mean nasty race conditions and dead locks don't exist. I'm just not aware of them :)
For more detailed documentation, refer to the Util Library Tutorial and Util Library Specifications . See Also: The Event Generator Idiom by Bill Venners.
EventGenerator
,
Serialized FormConstructor Summary | |
---|---|
EventGeneratorSupport()
Constructs support object. |
Method Summary | |
---|---|
protected void |
addListener(java.util.EventListener listener)
Registers a new listener to this object. |
java.lang.Object |
clone()
[PENDING] |
protected java.util.Enumeration |
getListeners()
Returns the listeners registered to this object. |
boolean |
hasListeners()
Checks if any registered listeners exist. |
protected void |
removeListener(java.util.EventListener listener)
Unregisters a listener from this object. |
java.awt.Component |
toComponent()
[PENDING] |
java.lang.String |
toString()
Returns a string representation of this EventGeneratorSupport object. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EventGeneratorSupport()
Method Detail |
---|
public boolean hasListeners()
protected java.util.Enumeration getListeners()
protected void addListener(java.util.EventListener listener)
This method is marked as protected and is supposed to be used only by the concrete implementations of generator support classes. The concrete subclasses must ensure only the correct type of listeners are allowed to register, as this method allows any listener to be added, therefore not being type safe.
listener
- the listener objectprotected void removeListener(java.util.EventListener listener)
listener
- the listener objectpublic java.lang.String toString()
The output will be similar to the following form:
EventGeneratorSupport[Registered Listeners=1]
toString
in class java.lang.Object
public java.awt.Component toComponent()
toComponent
in interface Visualizable
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |