Package arez.component
Interface ComponentObservable
- All Known Implementing Classes:
ComponentKernel
public interface ComponentObservable
Interface implemented by components so that observers can observe the component without
observing a particular property.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentObservableasComponentObservable(Object object) Cast specified object to an instance of ComponentObservable.static booleanmaybeObserve(Object object) Invokeobserve()on the supplied object if not null.static booleannotObserved(Object object) Return true ifobserve(Object)returns false for the same parameter.booleanobserve()Return true if the component is "alive" a.k.a.static booleanInvokeobserve()on the supplied object.
-
Method Details
-
observe
boolean observe()Return true if the component is "alive" a.k.a. not disposing or disposed. This method MUST be invoked within a non-DISPOSE transaction and will add the component as a dependency if the transaction is tracking, unless this component is disposing or disposed.- Returns:
- true if the component is "alive" a.k.a. not disposing or disposed.
-
observe
Invokeobserve()on the supplied object.- Parameters:
object- the object to observe.- Returns:
- true if the component is not disposing or disposed, false otherwise.
-
maybeObserve
Invokeobserve()on the supplied object if not null.- Parameters:
object- the object to observe if not null.- Returns:
- true if the component is null or not disposing or disposed, false otherwise.
-
notObserved
Return true ifobserve(Object)returns false for the same parameter.- Parameters:
object- the object to observe if any.- Returns:
- true if
observe(Object)returns false for the same parameter, false otherwise.
-
asComponentObservable
Cast specified object to an instance of ComponentObservable. Invariant checks will verify that the cast is valid before proceeding.- Parameters:
object- the object.- Returns:
- the object cast to ComponentObservable.
-