Class ValBase<T>

    • Field Detail

      • valid

        private boolean valid
      • value

        private T value
    • Constructor Detail

      • ValBase

        public ValBase()
    • Method Detail

      • getValue

        public final T getValue()
        Specified by:
        getValue in interface javafx.beans.value.ObservableValue<T>
      • observeInputs

        protected final Subscription observeInputs()
        Description copied from class: ObservableBase
        Starts observing this observable's input(s), if any. This method is called when the number of observers goes from 0 to 1. This method is called before ObservableBase.newObserver(Object) is called for the first observer.
        Specified by:
        observeInputs in class ObservableBase<java.util.function.Consumer<? super T>,​T>
        Returns:
        subscription used to stop observing inputs. The subscription is unsubscribed (i.e. input observation stops) when the number of observers goes down to 0.
      • invalidate

        protected final void invalidate()
      • newObserver

        protected final void newObserver​(java.util.function.Consumer<? super T> oldValueObserver)
        Description copied from class: ObservableBase
        Called for each new observer. Overriding this method is a convenient way for subclasses to handle this event, for example to publish some initial events.

        This method is called after the ObservableBase.observeInputs() method.

        Overrides:
        newObserver in class ObservableBase<java.util.function.Consumer<? super T>,​T>
      • connect

        protected abstract Subscription connect()
        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 invalidate() to notify observers of this Val. By the time of calling invalidate(), the input observer must have already updated any internal state of this Val, so that a subsequent call to computeValue() returns the current value of this Val.
        Returns:
        Subscription that can be used to stop observing inputs.
      • computeValue

        protected abstract T computeValue()