public class AbstractSignal<T> extends Reactor implements SignalView<T>
Reactor.RListener
SignalView.Listener<T>
Constructor and Description |
---|
AbstractSignal() |
Modifier and Type | Method and Description |
---|---|
<M> SignalView<M> |
collect(Function<? super T,M> collector)
Creates a signal that maps the values emitted by this signal through
collector and
emits only the non-null values that are returned. |
Connection |
connect(SignalView.Listener<? super T> slot)
Connects this signal to the supplied slot, such that when an event is emitted from this
signal, the slot will be notified.
|
void |
disconnect(SignalView.Listener<? super T> slot)
Disconnects the supplied slot from this signal if connect was called with it.
|
SignalView<T> |
filter(Function<? super T,Boolean> pred)
Creates a signal that emits a value only when the supplied filter function returns true.
|
<M> SignalView<M> |
map(Function<? super T,M> func)
Creates a signal that maps this signal via a function.
|
RFuture<T> |
next()
Returns a future that is completed with the next value from this signal.
|
clearConnections, hasConnections
public <M> SignalView<M> map(Function<? super T,M> func)
SignalView
map
in interface SignalView<T>
public SignalView<T> filter(Function<? super T,Boolean> pred)
SignalView
filter
in interface SignalView<T>
public <M> SignalView<M> collect(Function<? super T,M> collector)
SignalView
collector
and
emits only the non-null values that are returned. This allows you to perform a type-test on
the values emitted by a signal and only emit values of the appropriate subtype.collect
in interface SignalView<T>
public RFuture<T> next()
SignalView
next
in interface SignalView<T>
public Connection connect(SignalView.Listener<? super T> slot)
SignalView
connect
in interface SignalView<T>
public void disconnect(SignalView.Listener<? super T> slot)
SignalView
disconnect
in interface SignalView<T>
Copyright © 2017. All rights reserved.