public abstract class Slot<T> extends Object implements ValueView.Listener<T>, SignalView.Listener<T>
Constructor and Description |
---|
Slot() |
Modifier and Type | Method and Description |
---|---|
<S extends T> |
andThen(Slot<? super S> after)
Returns a new slot that invokes this slot and then evokes
after . |
<S> Slot<S> |
compose(Function<S,T> f)
Returns a slot that maps values via
f and then passes them to this slot. |
<S extends T> |
filtered(Function<? super S,Boolean> pred)
Returns a slot that is only notified when the signal to which this slot is connected emits a
value which causes
pred to return true. |
void |
onChange(T value,
T oldValue)
Allows a slot to be used as a
ValueView.Listener by passing just the new value
through to SignalView.Listener.onEmit(T) . |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onEmit
public <S> Slot<S> compose(Function<S,T> f)
f
and then passes them to this slot.
This is essentially function composition in that slot.compose(f)
means
slot(f(value)))
where this slot is treated as a side effecting void function.public <S extends T> Slot<S> filtered(Function<? super S,Boolean> pred)
pred
to return true.public <S extends T> Slot<S> andThen(Slot<? super S> after)
after
.public final void onChange(T value, T oldValue)
ValueView.Listener
by passing just the new value
through to SignalView.Listener.onEmit(T)
.onChange
in interface ValueView.Listener<T>
Copyright © 2017. All rights reserved.