Package org.reactfx.value
Class VarFromVal<T>
- java.lang.Object
-
- org.reactfx.ProxyObservable<java.util.function.Consumer<? super T>,java.util.function.Consumer<? super U>,Val<U>>
-
- org.reactfx.value.ProxyVal<T,T>
-
- org.reactfx.value.VarFromVal<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<java.util.function.Consumer<? super T>>
,Val<T>
,Var<T>
class VarFromVal<T> extends ProxyVal<T,T> implements Var<T>
-
-
Field Summary
Fields Modifier and Type Field Description private Subscription
binding
private java.util.function.Consumer<T>
setter
-
Constructor Summary
Constructors Constructor Description VarFromVal(Val<T> underlying, java.util.function.Consumer<T> setter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.function.Consumer<? super T>
adaptObserver(java.util.function.Consumer<? super T> observer)
Adapts the given observer to observer of the underlying Observable.void
bind(javafx.beans.value.ObservableValue<? extends T> observable)
T
getValue()
boolean
isBound()
void
setValue(T value)
void
unbind()
-
Methods inherited from class org.reactfx.ProxyObservable
addObserver, getUnderlyingObservable, observe, removeObserver
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.reactfx.Observable
addObserver, observe, removeObserver
-
Methods inherited from interface org.reactfx.value.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, values
-
Methods inherited from interface org.reactfx.value.Var
bindBidirectional, getBean, getName, mapBidirectional, suspendable, unbindBidirectional
-
-
-
-
Field Detail
-
setter
private final java.util.function.Consumer<T> setter
-
binding
private Subscription binding
-
-
Method Detail
-
getValue
public T getValue()
-
adaptObserver
protected java.util.function.Consumer<? super T> adaptObserver(java.util.function.Consumer<? super T> observer)
Description copied from class:ProxyObservable
Adapts the given observer to observer of the underlying Observable.Important: It is required that the transformation applied to two observers that are _equal_ yields two adapted observers that are _equal_. In other words, if `o1.equals(o2)`, then it must be the case that `adaptObserver(o1).equals(adaptObserver(o2))`.
- Specified by:
adaptObserver
in classProxyObservable<java.util.function.Consumer<? super T>,java.util.function.Consumer<? super T>,Val<T>>
- Parameters:
observer
- observer to be adapted for the underlying Observable- Returns:
- observer adapted for the underlying Observable
-
bind
public void bind(javafx.beans.value.ObservableValue<? extends T> observable)
- Specified by:
bind
in interfacejavafx.beans.property.Property<T>
-
unbind
public void unbind()
- Specified by:
unbind
in interfacejavafx.beans.property.Property<T>
-
isBound
public boolean isBound()
- Specified by:
isBound
in interfacejavafx.beans.property.Property<T>
-
-