Package org.reactfx

Class ToggleFromVal

All Implemented Interfaces:
javafx.beans.Observable, javafx.beans.value.ObservableValue<Boolean>, Observable<Consumer<? super Boolean>>, Suspendable, Toggle, Val<Boolean>

class ToggleFromVal extends ProxyVal<Boolean,Boolean> implements Toggle
  • Field Details

  • Constructor Details

  • Method Details

    • getValue

      public Boolean getValue()
      Specified by:
      getValue in interface javafx.beans.value.ObservableValue<Boolean>
    • suspend

      public Guard suspend()
      Description copied from interface: Suspendable
      Suspends this suspendable object.

      In case of suspendable Observable, suspends notification delivery for this observable object. Notifications produced while suspended may be queued for later delivery, accumulated into a single cumulative notification, or discarded completely, depending on the concrete implementation.

      Specified by:
      suspend in interface Suspendable
      Returns:
      a Guard instance that can be released to end suspension. In case of suspended notifications, releasing the returned Guard will trigger delivery of queued or accumulated notifications, if any.

      The returned Guard is AutoCloseable, which makes it convenient to use in try-with-resources.

    • adaptObserver

      protected Consumer<? super Boolean> adaptObserver(Consumer<? super Boolean> observer)
      Description copied from class: ProxyObservable
      Adapts the given observer to observer of the underlying Observable.

      Important: It is required that the transformation applied to two observers that are _equal_ yields two adapted observers that are _equal_. In other words, if `o1.equals(o2)`, then it must be the case that `adaptObserver(o1).equals(adaptObserver(o2))`.

      Specified by:
      adaptObserver in class ProxyObservable<Consumer<? super Boolean>,Consumer<? super Boolean>,Val<Boolean>>
      Parameters:
      observer - observer to be adapted for the underlying Observable
      Returns:
      observer adapted for the underlying Observable