T- the common type of the observed events
public interface Observable<T extends Event>
An observable object can have one or more observers. Each observer is associated with a particular event class.
<E extends T> Subscription on(java.lang.Class<E> eventClass, Observer<E> observer)
observerto 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
observerhas been already registered.
E- the event type
eventClass- the event class
observer- the event observer to subscribe
Subscriptionreference with which the subscribers can unsubscribe from the
Observable. If the given observer is already registered, returns a reference to already created