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 java.lang.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 Modifier and Type Field Description private Uunderlying
-
Constructor Summary
Constructors Modifier Constructor Description protectedProxyObservable(U underlying)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract PadaptObserver(O observer)Adapts the given observer to observer of the underlying Observable.voidaddObserver(O observer)protected UgetUnderlyingObservable()Subscriptionobserve(O observer)voidremoveObserver(O observer)
-
-
-
Field Detail
-
underlying
private final U extends Observable<P> underlying
-
-
Constructor Detail
-
ProxyObservable
protected ProxyObservable(U underlying)
-
-
Method Detail
-
adaptObserver
protected abstract P adaptObserver(O observer)
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
protected final U getUnderlyingObservable()
-
addObserver
public final void addObserver(O observer)
- Specified by:
addObserverin interfaceObservable<O>
-
removeObserver
public final void removeObserver(O observer)
- Specified by:
removeObserverin interfaceObservable<O>
-
observe
public final Subscription observe(O observer)
- Specified by:
observein interfaceObservable<O>
-
-