Class MappedVal<T,​U>

  • All Implemented Interfaces:
    javafx.beans.Observable, javafx.beans.value.ObservableValue<U>, Observable<java.util.function.Consumer<? super U>>, ProperObservable<java.util.function.Consumer<? super U>,​U>, ProperVal<U>, Val<U>

    class MappedVal<T,​U>
    extends ValBase<U>
    • Field Detail

      • src

        private final javafx.beans.value.ObservableValue<T> src
      • f

        private final java.util.function.Function<? super T,​? extends U> f
    • Constructor Detail

      • MappedVal

        MappedVal​(javafx.beans.value.ObservableValue<T> src,
                  java.util.function.Function<? super T,​? extends U> f)
    • Method Detail

      • connect

        protected 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<U>
        Returns:
        Subscription that can be used to stop observing inputs.