-
- All Known Implementing Classes:
DefaultScope,Listener.MultiplexListener
public interface ListenerA listener observing anObservableobject.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classListener.MultiplexListener
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidafterRemove(Observable obj, String property, int index, Object element)Informs thisListenerthat an element was removed from a repeated property with the given name.default voidafterRemove(Observable obj, String property, Object index, Object element)Informs thisListenerthat an element was removed from a map property with the given name.default voidbeforeAdd(Observable obj, String property, int index, Object element)Informs thisListenerthat an element will be added to the repeated property with the given name.default voidbeforeAdd(Observable obj, String property, Object index, Object element)Informs thisListenerthat an element will be added to the map property with the given name.voidbeforeSet(Observable obj, String property, Object value)Informs thisListenerthat the value of the given property is to be modified.static Listenerregister(Listener current, Listener added)static Listenerunregister(Listener current, Listener removed)
-
-
-
Method Detail
-
beforeSet
void beforeSet(Observable obj, String property, Object value)
Informs thisListenerthat the value of the given property is to be modified.- Parameters:
obj- TheObservableobject.property- The name of the property to be modified.value- The new value that is being set to the given property.
-
beforeAdd
default void beforeAdd(Observable obj, String property, int index, Object element)
Informs thisListenerthat an element will be added to the repeated property with the given name.- Parameters:
obj- TheObservableobject.property- The name of the property to be modified.index- The index where the new element will be added if the property is ordered,-1otherwise.element- The new element that is being added to the given property.
-
beforeAdd
default void beforeAdd(Observable obj, String property, Object index, Object element)
Informs thisListenerthat an element will be added to the map property with the given name.- Parameters:
obj- TheObservableobject.property- The name of the property to be modified.index- The index where the new element will be added if the property is ordered,-1otherwise.element- The new element that is being added to the given property.
-
afterRemove
default void afterRemove(Observable obj, String property, int index, Object element)
Informs thisListenerthat an element was removed from a repeated property with the given name.- Parameters:
obj- TheObservableobject.property- The name of the property to be modified.index- The index where the element was removed if the property is ordered,-1otherwise.element- The element that was removed from the given property.
-
afterRemove
default void afterRemove(Observable obj, String property, Object index, Object element)
Informs thisListenerthat an element was removed from a map property with the given name.- Parameters:
obj- TheObservableobject.property- The name of the property to be modified.index- The index where the element was removed if the property is ordered,-1otherwise.element- The element that was removed from the given property.
-
register
static Listener register(Listener current, Listener added)
Utility to use a single field of typeListeneras storage for potentially multiple attachedListeners.To be used in the following way:
_listener = Listener.register(_listener, newListener);- Parameters:
current- The current value of the the listener field.added- The newListenerto add.- Returns:
- The new value to store in the listener field.
-
unregister
static Listener unregister(Listener current, Listener removed)
- Parameters:
current- The current value of the the listener field.removed- TheListenerto remove.- Returns:
- The new value to store in the listener field.
- See Also:
register(Listener, Listener)
-
-