Package io.github.mmm.value.observable
Interface WritableObservableValue<V>
- Type Parameters:
V- type of thevalue.
- All Superinterfaces:
EventSource<ObservableEvent<V>,,ObservableEventListener<? super V>> ObservableValue<V>,ReadableValue<V>,Supplier<V>,WritableValue<V>
- All Known Implementing Classes:
AbstractWritableObservableValue
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidbindOneWay(ObservableValue<? extends V> observable) Creates a unidirection binding for this object.
ATTENTION:
An unidirectional binding is very strict.voidbindTwoWay(WritableObservableValue<V> other) Create a bidirectional binding between this object and the given one.booleanvoidRemoves theunidirectional bindingfrom this object.voidunbindTwoWay(WritableObservableValue<V> other) Removes abidirectional bindingbetween this object and the given one.Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListenerMethods inherited from interface io.github.mmm.value.observable.ObservableValue
toStringMethods inherited from interface io.github.mmm.value.ReadableValue
get, getSafeMethods inherited from interface io.github.mmm.value.WritableValue
set
-
Method Details
-
bindOneWay
Creates a unidirection binding for this object.
ATTENTION:
An unidirectional binding is very strict. It makes this object to appear exactly as theObservableValueit is bound to. After creating the unidirectional binding, calls toWritableValue.set(Object)will fail. This is very different to anbidirectional binding.- Parameters:
observable- theObservableValuethis object should be bound to.- See Also:
-
unbindOneWay
void unbindOneWay()Removes theunidirectional bindingfrom this object. If this object is notbound, this method has no effect.- See Also:
-
isBoundOneWay
boolean isBoundOneWay()- Returns:
trueif this object isbound,falseotherwise.- See Also:
-
bindTwoWay
Create a bidirectional binding between this object and the given one. After a bidirectional binding,WritableValue.set(Object)on this object will propagate its value to the bound one and vice versa. Bidirectional bindings exists independently ofunidirectional bindings. However, it is bad practice to combine both. It is possible to have multiple bidirectional bindings for the same object.- Parameters:
other- the otherWritableObservableValueto bind bidirectional.- See Also:
-
unbindTwoWay
Removes abidirectional bindingbetween this object and the given one. If no bidirectional binding between these objects exists, this method has no effect. It is possible tounbindin inverse order. So to unbind twobidirectional boundobjects it does not matter if you callunbindBidirectionalon the first with the second as argument or vice versa.- Parameters:
other- the otherWritableObservableValueto unbind bidirectional.- See Also:
-