T - the common type of the observed eventspublic interface Observable<T extends Event>
An observable object can have one or more observers. Each observer is associated with a particular event class.
| Modifier and Type | Method and Description |
|---|---|
<E extends T> |
on(java.lang.Class<E> eventClass,
Observer<E> observer)
Subscribes the given event
observer to receive the events of the given eventClass. |
<E extends T> Subscription on(java.lang.Class<E> eventClass, Observer<E> observer)
observer to receive the events of the given eventClass. The order in which notifications will be delivered to the registered listeners
is not specified. The method does nothing if the given observer has been already
registered.E - the event typeeventClass - the event classobserver - the event observer to subscribeSubscription reference with which the subscribers can unsubscribe from the
Observable. If the given observer is already registered, returns a reference to
already created Subscription.