Class SimpleVar<T>

java.lang.Object
org.reactfx.ObservableBase<Consumer<? super T>,T>
org.reactfx.value.ValBase<T>
org.reactfx.value.SimpleVar<T>
All Implemented Interfaces:
javafx.beans.Observable, javafx.beans.property.Property<T>, javafx.beans.property.ReadOnlyProperty<T>, javafx.beans.value.ObservableValue<T>, javafx.beans.value.WritableValue<T>, Observable<Consumer<? super T>>, ProperObservable<Consumer<? super T>,T>, ProperVal<T>, Val<T>, Var<T>

class SimpleVar<T> extends ValBase<T> implements Var<T>
  • Field Details

    • boundToListener

      private final javafx.beans.InvalidationListener boundToListener
    • value

      private T value
    • boundTo

      private javafx.beans.value.ObservableValue<? extends T> boundTo
  • Constructor Details

    • SimpleVar

      public SimpleVar(T initialValue)
  • Method Details

    • bind

      public void bind(javafx.beans.value.ObservableValue<? extends T> other)
      Specified by:
      bind in interface javafx.beans.property.Property<T>
    • unbind

      public void unbind()
      Specified by:
      unbind in interface javafx.beans.property.Property<T>
    • isBound

      public boolean isBound()
      Specified by:
      isBound in interface javafx.beans.property.Property<T>
    • setValue

      public void setValue(T value)
      Specified by:
      setValue in interface javafx.beans.value.WritableValue<T>
    • 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<T>
      Returns:
      Subscription that can be used to stop observing inputs.
    • computeValue

      protected T computeValue()
      Specified by:
      computeValue in class ValBase<T>