|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Observable
dispatches events to which listeners
can subscribe. Aka
publish-subscribe.
a default implementation of this interface
Method Summary | |
---|---|
void |
addListener(Listener listener)
subscribes a listener to every event |
Listener |
addListener(Listener listener,
java.util.List<java.lang.String> eventNames)
subscribes the listener to receive event notifications only if event matches one of the given eventNames. |
Listener |
addListener(Listener listener,
java.lang.String eventName)
subscribes the listener to receive event notifications only of the given eventName. |
void |
fire(java.lang.String eventName)
dispatches an event to the listeners. |
void |
fire(java.lang.String eventName,
java.lang.Object info)
dispatches an event to the listeners. |
void |
removeListener(Listener listener)
removes a listener that was subscribed for every event |
Method Detail |
---|
void addListener(Listener listener)
listener
- is the object that will be notified on
firing
of events.void removeListener(Listener listener)
Listener addListener(Listener listener, java.lang.String eventName)
listener
- is the object that will be notified on
firing
of events.eventName
- is the type of events the listener is interested in and this is
mandatory.
FilterListener
that is created as a wrapper for the
given listener. That handle might be necessary to remove the
listener later on.
java.lang.NullPointerException
- in case listener or eventName is null.Listener addListener(Listener listener, java.util.List<java.lang.String> eventNames)
listener
- is the object that will be notified on
firing
of events.eventNames
- is the type of events the listener is interested in and this is
mandatory.
FilterListener
that is created as a wrapper for the
given listener. That handle might be necessary to remove the
listener later on.
java.lang.NullPointerException
- in case listener or eventName is null.void fire(java.lang.String eventName)
eventName
- identifies the type of event and is allowed to be null.void fire(java.lang.String eventName, java.lang.Object info)
eventName
- identifies the type of event and is allowed to be null.info
- is the optional information that the observable wants to pass to
it's listeners. Each observable should indicate which type of info
it's passing for each event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |