|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of object held.public interface ObservableValue<T>
Instances of ObservableValue encapsulate an observable reference of type
T
. The reference may not exist yet, be null, or point to an
allocated object.
ObservableValues should be accessed by at most one thread at a time. Reentrant calls are permitted.
InquisitiveValueObservers
are
supported. They can be subscribed like ordinary ValueObservers.
Note to implementors: If LiveValues may depend on instances of your
class, you must invoke
LiveValue.observableGetterInterceptor()
whenever get()
may have been invoked from a LiveValue. (We do not
require this by static means to avoid loading LiveValue regardless of whether
it is used.)
ValueObserver
Method Summary | |
---|---|
T |
get()
|
void |
subscribe(ValueObserver<? super T> o)
subscribe to this observable's change notifications. |
void |
subscribeSilently(ValueObserver<? super T> o)
subscribe to this observable's change notifications without getting an initial change notification. |
void |
unsubscribe(ValueObserver<? super T> o)
unsubscribes from this observable's change notifications, i.e. no change notification will be sent anymore. |
Method Detail |
---|
void subscribeSilently(ValueObserver<? super T> o)
o
- the object to receive change notificationsvoid subscribe(ValueObserver<? super T> o)
o
- the object to receive change notificationsvoid unsubscribe(ValueObserver<? super T> o)
o
- the object no longer to receive change notificationsT get() throws IllegalStateException
IllegalStateException
- if the observed reference does not
exist yet.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |