Package org.reactfx

Class SuspendableBoolean

  • All Implemented Interfaces:
    javafx.beans.Observable, javafx.beans.value.ObservableBooleanValue, javafx.beans.value.ObservableValue<java.lang.Boolean>, Observable<java.util.function.Consumer<? super java.lang.Boolean>>, ProperObservable<java.util.function.Consumer<? super java.lang.Boolean>,​java.lang.Boolean>, Suspendable, Toggle, ProperVal<java.lang.Boolean>, Val<java.lang.Boolean>
    Direct Known Subclasses:
    SuspendableNo, SuspendableYes

    abstract class SuspendableBoolean
    extends ValBase<java.lang.Boolean>
    implements javafx.beans.value.ObservableBooleanValue, Toggle
    • Field Detail

      • suspenders

        private int suspenders
    • Constructor Detail

      • SuspendableBoolean

        SuspendableBoolean()
    • Method Detail

      • suspend

        public final 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.

      • release

        private void release()
      • isSuspended

        protected final boolean isSuspended()
      • connect

        protected final Subscription connect()
        Description copied from class: ValBase
        Implementation of this method should start observing inputs. If the value of this Val may change as a result of input change, the corresponding input observer should call ValBase.invalidate() to notify observers of this Val. By the time of calling ValBase.invalidate(), the input observer must have already updated any internal state of this Val, so that a subsequent call to ValBase.computeValue() returns the current value of this Val.
        Specified by:
        connect in class ValBase<java.lang.Boolean>
        Returns:
        Subscription that can be used to stop observing inputs.
      • computeValue

        protected final java.lang.Boolean computeValue()
        Specified by:
        computeValue in class ValBase<java.lang.Boolean>