Package net.apartium.cocoabeans.state
Class ObservableCompound<T>
java.lang.Object
net.apartium.cocoabeans.state.ObservableCompound<T>
- All Implemented Interfaces:
Observable<T>,Observer
-
Constructor Summary
ConstructorsConstructorDescriptionObservableCompound(Function<List<?>, T> singularMapper, List<Observable<?>> list) -
Method Summary
Modifier and TypeMethodDescriptionvoidflagAsDirty(Observable<?> observable) Flag listener as dirtyget()Will return the value of the state if it is dirty it will recompute itvoidAdds an observer to the statebooleanremoveObserver(Observer observer) Removes an observer from the stateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.apartium.cocoabeans.state.Observable
map, watch
-
Constructor Details
-
ObservableCompound
-
-
Method Details
-
get
Description copied from interface:ObservableWill return the value of the state if it is dirty it will recompute it- Specified by:
getin interfaceObservable<T>- Returns:
- value of state after recomputing if dirty otherwise the current value
-
observe
Description copied from interface:ObservableAdds an observer to the state- Specified by:
observein interfaceObservable<T>- Parameters:
observer- the observer we want to add- See Also:
-
removeObserver
Description copied from interface:ObservableRemoves an observer from the state- Specified by:
removeObserverin interfaceObservable<T>- Parameters:
observer- observer we want to remove- Returns:
- true if the observer was listening, false otherwise
- See Also:
-
flagAsDirty
Description copied from interface:ObserverFlag listener as dirty- Specified by:
flagAsDirtyin interfaceObserver- Parameters:
observable- marking observable
-