Package org.reactfx
Class ProxyObservable<O,P,U extends Observable<P>>
java.lang.Object
org.reactfx.ProxyObservable<O,P,U>
- Type Parameters:
O
- observer type accepted by this ObservableP
- observer type accepted by the underlying ObservableU
- type of the underlying observable to which observers are delegated
- All Implemented Interfaces:
Observable<O>
- Direct Known Subclasses:
ProxyVal
public abstract class ProxyObservable<O,P,U extends Observable<P>>
extends Object
implements Observable<O>
An Observable that does not maintain its own collection of
observers, but rather adapts and registers every given observer with the
underlying Observable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract P
adaptObserver
(O observer) Adapts the given observer to observer of the underlying Observable.final void
addObserver
(O observer) protected final U
final Subscription
final void
removeObserver
(O observer)
-
Field Details
-
underlying
-
-
Constructor Details
-
ProxyObservable
-
-
Method Details
-
adaptObserver
Adapts the given observer to observer of the underlying Observable.Important: It is required that the transformation applied to two observers that are _equal_ yields two adapted observers that are _equal_. In other words, if `o1.equals(o2)`, then it must be the case that `adaptObserver(o1).equals(adaptObserver(o2))`.
- Parameters:
observer
- observer to be adapted for the underlying Observable- Returns:
- observer adapted for the underlying Observable
-
getUnderlyingObservable
-
addObserver
- Specified by:
addObserver
in interfaceObservable<O>
-
removeObserver
- Specified by:
removeObserver
in interfaceObservable<O>
-
observe
- Specified by:
observe
in interfaceObservable<O>
-