Package io.github.mmm.value.observable
Class BidirectionalBinding<V>
- java.lang.Object
-
- io.github.mmm.value.observable.BidirectionalBinding<V>
-
- Type Parameters:
V- type of observedvalue.
- All Implemented Interfaces:
EventListener<ObservableEvent<V>>,ObservableEventListener<V>
public class BidirectionalBinding<V> extends Object implements ObservableEventListener<V>
ObservableEventListenerfor a bidirectional binding.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> BidirectionalBinding<V>bind(WritableObservableValue<V> property1, WritableObservableValue<V> property2)booleanequals(Object obj)inthashCode()booleanisMatchedUsingEquals()voidonEvent(ObservableEvent<V> event)This method is called if an event occurred.voidunbind()static <V> voidunbind(WritableObservableValue<V> property1, WritableObservableValue<V> property2)
-
-
-
Method Detail
-
onEvent
public void onEvent(ObservableEvent<V> event)
Description copied from interface:EventListenerThis method is called if an event occurred.
WARNING:
Depending on the implementation ofEventSourceit may NOT be legal toaddorremovelisteners during the call of this method as this may lead to a dead-lock.- Specified by:
onEventin interfaceEventListener<V>- Parameters:
event- is the event that notifies about something that happened.
-
isMatchedUsingEquals
public boolean isMatchedUsingEquals()
- Specified by:
isMatchedUsingEqualsin interfaceEventListener<V>- Returns:
trueif to match usingequals,falseto match via object identity (compared using==). For better performance the default isfalse. If you implement this interface as a class overridingequalsin order to being able toremovetheEventListenerwithout keeping its reference by creating a newequalEventListenerinstance, then you simply need to override this method returningtrue.
-
unbind
public void unbind()
-
bind
public static <V> BidirectionalBinding<V> bind(WritableObservableValue<V> property1, WritableObservableValue<V> property2)
- Type Parameters:
V- type of observedvalue.- Parameters:
property1- the firstWritableObservableValueto bind.property2- the secondWritableObservableValueto bind.- Returns:
- the
BidirectionalBinding. - See Also:
WritableObservableValue.bindTwoWay(WritableObservableValue)
-
unbind
public static <V> void unbind(WritableObservableValue<V> property1, WritableObservableValue<V> property2)
- Type Parameters:
V- type of observedvalue.- Parameters:
property1- the firstWritableObservableValueto unbind.property2- the secondWritableObservableValueto unbind.- See Also:
WritableObservableValue.unbindTwoWay(WritableObservableValue)
-
-