Package org.reactfx
Interface Observable<O>
- Type Parameters:
O
- observer type accepted by this Observable
- All Known Subinterfaces:
AwaitingEventStream<T>
,CompletionStageStream<T>
,ConnectableEventStream<T>
,EventStream<T>
,LiveList<E>
,MemoizationList<E>
,ProperEventStream<T>
,ProperLiveList<E>
,ProperObservable<O,
,T> ProperVal<T>
,SuspendableEventStream<T>
,SuspendableList<E>
,SuspendableVal<T>
,SuspendableVar<T>
,SuspenderStream<T,
,S> TaskStream<T>
,Toggle
,Val<T>
,Var<T>
- All Known Implementing Classes:
AbstractReducibleEventStream
,AccumulateBetweenStream
,AccumulateUntilLaterStream
,AccumulatingStream
,AccumulativeEventStream
,AnimatedVal
,Await
,AwaitLatest
,ConnectableEventSource
,ConstVal
,DefaultEventStream
,DistinctStream
,DynamicallyMappedList
,EmitBothOnEachStream
,EmitOnEachStream
,EmitOnStream
,EventSource
,EventStreamBase
,EventStreams.Never
,FilterMapStream
,FilterStream
,FlatMapOptStream
,FlatMapped
,FlatMappedVal
,FlatMappedVar
,FlatMapStream
,ForgetfulEventStream
,HookStream
,LatestNStream
,ListRangeReduction
,ListReduction
,LiveArrayList
,LiveListBase
,MappedList
,MappedStream
,MappedToCompletionStageStream
,MappedToTaskStream
,MappedVal
,MemoizationListImpl
,MemoizationListImpl.MemoizedView
,ObservableBase
,OrElse
,OrElseConst
,PausableEventStream
,ProxyObservable
,ProxyVal
,RecursiveStream
,ReducibleEventStream
,RepeatOnStream
,RigidObservable
,SimpleVar
,StatefulStream
,StateStream
,SuccessionReducingStream
,SuppressibleEventStream
,SuspendableBase
,SuspendableBoolean
,SuspendableEventStreamBase
,SuspendableListWrapper
,SuspendableNo
,SuspendableValWrapper
,SuspendableVarWrapper
,SuspendableYes
,SuspendedWhenStream
,SuspenderBase
,SuspenderStreamImpl
,ThenAccumulateForStream
,ThreadBridge
,ToggleFromVal
,ValAsList
,ValBase
,ValWrapper
,VarFromVal
,VarWrapper
public interface Observable<O>
Anything that can be observed, that is have an observer
added and removed. Each Observable has one canonical observer
type, which can be added by the
addObserver(Object)
method and
removed by the removeObserver(Object)
method, or added by the
observe(Object)
method and removed by the returned
Subscription.
In specific subtypes, methods for adding/removing canonical observers may
have aliases that are more descriptive for the specific type, for example,
in EventStream
, observe(Object) is aliased as
EventStream.subscribe(java.util.function.Consumer), or in
Val
, addObserver(Object) is aliased as
Val.addInvalidationObserver(java.util.function.Consumer).
In addition to the canonical observer, subtypes may support adding other
observer types. These other observers will be wrapped to "look like" a
canonical observer. For example, the canonical observer for
Val<T>
is an invalidation observer, which is of type
Consumer<? super T>
, which accepts the invalidated value.
In addition to this canonical observer, Val also supports
InvalidationListener
s and ChangeListener
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(O observer) default Subscription
void
removeObserver
(O observer)
-
Method Details
-
addObserver
-
removeObserver
-
observe
-