Top Fields Constructors Methods
org.reactfx.value

pack-priv Class SimpleVar<T>

extends ValBase<T>
implements Var<T>
Class Inheritance
All Implemented Interfaces
org.reactfx.value.Var, javafx.beans.property.Property, javafx.beans.value.WritableValue, javafx.beans.property.ReadOnlyProperty, javafx.beans.value.ObservableValue, javafx.beans.Observable, org.reactfx.value.Val, org.reactfx.Observable
Imports
java.util.Objects, javafx.beans.InvalidationListener, javafx.beans.value.ObservableValue, org.reactfx.Subscription

Field Summary

Modifier and TypeField and Description
private ObservableValue<? extends T>
private final InvalidationListener
private T

Constructor Summary

AccessConstructor and Description
public
SimpleVar(T initialValue)

Method Summary

Modifier and TypeMethod and Description
public void
bind(ObservableValue<? extends T> other)

Implements javafx.beans.property.Property.bind.

Create a unidirection binding for this Property.

protected T
protected Subscription
connect()

Implements abstract org.reactfx.value.ValBase.connect.

Implementation of this method should start observing inputs.

public boolean
isBound()

Implements javafx.beans.property.Property.isBound.

Can be used to check, if a Property is bound.

public void
setValue(T value)

Implements javafx.beans.value.WritableValue.setValue.

Set the wrapped value.

public void
unbind()

Implements javafx.beans.property.Property.unbind.

Remove the unidirectional binding for this Property.

Inherited from org.reactfx.value.ValBase:
getValueinvalidatenewObserverobserveInputs

Field Detail

boundToback to summary
private ObservableValue<? extends T> boundTo
boundToListenerback to summary
private final InvalidationListener boundToListener
valueback to summary
private T value

Hides org.reactfx.value.ValBase.value.

Constructor Detail

SimpleVarback to summary
public SimpleVar(T initialValue)

Method Detail

bindback to summary
public void bind(ObservableValue<? extends T> other)

Implements javafx.beans.property.Property.bind.

Doc from javafx.beans.property.Property.bind.

Create a unidirection binding for this Property.

Note that JavaFX has all the bind calls implemented through weak listeners. This means the bound property can be garbage collected and stopped from being updated.

Annotations
@Override
computeValueback to summary
protected T computeValue()

Implements abstract org.reactfx.value.ValBase.computeValue.

Annotations
@Override
connectback to summary
protected Subscription connect()

Implements abstract org.reactfx.value.ValBase.connect.

Doc from org.reactfx.value.ValBase.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.

Annotations
@Override
isBoundback to summary
public boolean isBound()

Implements javafx.beans.property.Property.isBound.

Doc from javafx.beans.property.Property.isBound.

Can be used to check, if a Property is bound.

Annotations
@Override
setValueback to summary
public void setValue(T value)

Implements javafx.beans.value.WritableValue.setValue.

Doc from javafx.beans.value.WritableValue.setValue.

Set the wrapped value.

Annotations
@Override
unbindback to summary
public void unbind()

Implements javafx.beans.property.Property.unbind.

Doc from javafx.beans.property.Property.unbind.

Remove the unidirectional binding for this Property. If the Property is not bound, calling this method has no effect.

Annotations
@Override