Interface Observable<T extends Event>

Type Parameters:
T - the common type of the observed events
All Known Subinterfaces:
Audio, Browser, CaptureSession, CastSession, CastSessions, Download, Engine, FullScreen, MediaReceiver, MediaReceivers, Navigation, Network, PrintJob<PrintSettingT>, ZoomLevels

public interface Observable<T extends Event>
An observable object.

An observable object can have one or more observers. Each observer is associated with a particular event class.

  • Method Summary

    Modifier and Type
    Method
    Description
    <E extends T>
    Subscription
    on(Class<E> eventClass, Observer<E> observer)
    Subscribes the given event observer to receive the events of the given eventClass.
  • Method Details

    • on

      <E extends T> Subscription on(Class<E> eventClass, Observer<E> observer)
      Subscribes the given event 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.
      Type Parameters:
      E - the event type
      Parameters:
      eventClass - the event class
      observer - the event observer to subscribe
      Returns:
      a Subscription reference with which the subscribers can unsubscribe from the Observable. If the given observer is already registered, returns a reference to already created Subscription.