Class SuspendableBoolean
- All Implemented Interfaces:
javafx.beans.Observable, javafx.beans.value.ObservableBooleanValue, javafx.beans.value.ObservableValue<Boolean>, Observable<Consumer<? super Boolean>>, ProperObservable<Consumer<? super Boolean>, Boolean>, Suspendable, Toggle, ProperVal<Boolean>, Val<Boolean>
- Direct Known Subclasses:
SuspendableNo, SuspendableYes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Booleanprotected final Subscriptionconnect()Implementation of this method should start observing inputs.protected final booleanEventStream<?> noes()private voidrelease()final Guardsuspend()Suspends this suspendable object.EventStream<?> yeses()Methods inherited from class ValBase
getValue, invalidate, newObserver, observeInputsMethods inherited from class ObservableBase
addObserver, enqueueNotifications, equals, forEachObserver, getObserverCount, hashCode, isObservingInputs, notifyObservers, notifyObservers, observe, removeObserver, toStringMethods inherited from interface Observable
addObserver, observe, removeObserverMethods inherited from interface javafx.beans.value.ObservableBooleanValue
getMethods inherited from interface javafx.beans.value.ObservableValue
getValueMethods inherited from interface ProperObservable
defaultEquals, defaultHashCode, defaultToString, notifyObserversMethods inherited from interface ProperVal
defaultNotificationAccumulatorMethods inherited from interface Suspendable
suspendWhen, suspendWhile, suspendWhileMethods inherited from interface Val
addInvalidationObserver, addListener, addListener, animate, animate, asList, asVar, changes, conditionOn, conditionOnShowing, filter, flatMap, getOpt, getOrElse, getOrSupply, getOrThrow, ifPresent, invalidations, isEmpty, isPresent, map, mapDynamic, observeChanges, observeInvalidations, orElse, orElseConst, pin, removeInvalidationObserver, removeListener, removeListener, selectVar, selectVar, suspendable, values
-
Field Details
-
suspenders
private int suspenders
-
-
Constructor Details
-
SuspendableBoolean
SuspendableBoolean()
-
-
Method Details
-
suspend
Description copied from interface:SuspendableSuspends 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:
suspendin interfaceSuspendable- 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
GuardisAutoCloseable, which makes it convenient to use in try-with-resources.
-
release
private void release() -
yeses
-
noes
-
isSuspended
protected final boolean isSuspended() -
connect
Description copied from class:ValBaseImplementation 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 callValBase.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 toValBase.computeValue()returns the current value of this Val. -
computeValue
- Specified by:
computeValuein classValBase<Boolean>
-