- java.lang.Object
-
- swim.streamlet.AbstractMapInlet<K,V,O>
-
- Direct Known Subclasses:
MapOutput
,OutletMapInlet
,WatchFieldsOperator
public abstract class AbstractMapInlet<K,V,O> extends Object implements MapInlet<K,V,O>
-
-
Constructor Summary
Constructors Constructor Description AbstractMapInlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindInput(MapOutlet<K,V,? extends O> input)
void
bindInput(Outlet<? extends O> input)
Connects thisInlet
to anOutlet
from which it will acquire its state.void
decohereOutput()
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state.void
decohereOutputKey(K key, KeyEffect effect)
Marks thisMapInlet
as needing aneffect
applied to a givenkey
.protected void
didDecohereOutput()
protected void
didDecohereOutputKey(K key, KeyEffect effect)
protected void
didRecohereOutput(int version)
protected void
didRecohereOutputKey(K key, KeyEffect effect, int version)
void
disconnectInputs()
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph.MapOutlet<K,V,? extends O>
input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.protected void
onDecohereOutput()
protected void
onDecohereOutputKey(K key, KeyEffect effect)
protected void
onRecohereOutput(int version)
protected void
onRecohereOutputKey(K key, KeyEffect effect, int version)
void
recohereOutput(int version)
Updates the state of thisInlet
to make it consistent with thetarget
version.void
recohereOutputKey(K key, int version)
Updates the state of an individualkey
in thisMapInlet
to make it consistent with the targetversion
.void
unbindInput()
Disconnects thisInlet
from its inputOutlet
, if connected.protected void
willDecohereOutput()
protected void
willDecohereOutputKey(K key, KeyEffect effect)
protected void
willRecohereOutput(int version)
protected void
willRecohereOutputKey(K key, KeyEffect effect, int version)
-
-
-
Method Detail
-
input
public MapOutlet<K,V,? extends O> input()
Description copied from interface:Inlet
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.
-
bindInput
public void bindInput(Outlet<? extends O> input)
Description copied from interface:Inlet
Connects thisInlet
to anOutlet
from which it will acquire its state. If thisInlet
is already connected, it will first disconnect from its existing input. Then, after updating itsinput
property, theInlet
will invokeOutlet.bindOutput(Inlet)
on its newinput
.
-
unbindInput
public void unbindInput()
Description copied from interface:Inlet
Disconnects thisInlet
from its inputOutlet
, if connected. After setting itsinput
property tonull
, theInlet
will invokeOutlet.unbindOutput(Inlet)
on its old input, if defined.- Specified by:
unbindInput
in interfaceInlet<K>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:Inlet
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet
.- Specified by:
disconnectInputs
in interfaceInlet<K>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:Inlet
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet
.- Specified by:
disconnectOutputs
in interfaceInlet<K>
-
decohereOutputKey
public void decohereOutputKey(K key, KeyEffect effect)
Description copied from interface:MapInlet
Marks thisMapInlet
as needing aneffect
applied to a givenkey
. Decohering an individual key decoheres the entire state of theInlet
. But only the decoherent keys need to be updated in order to recohere the overall state of theInlet
.- Specified by:
decohereOutputKey
in interfaceMapInlet<K,V,O>
-
decohereOutput
public void decohereOutput()
Description copied from interface:Inlet
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state. Decohering anInlet
will recursively decohere all streamlets that transitively depend on the state of thisInlet
. Decohering anInlet
does not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)
call will eventually make the state of theInlet
coherent again.- Specified by:
decohereOutput
in interfaceInlet<K>
-
recohereOutputKey
public void recohereOutputKey(K key, int version)
Description copied from interface:MapInlet
Updates the state of an individualkey
in thisMapInlet
to make it consistent with the targetversion
. TheMapInlet
only needs to update if the currentversion
differs from the targetversion
. To update the state of a key, theMapInlet
first invokesMapOutlet.recohereInputKey(Object, int)
on itsinput
, if its input is aMapOutlet
, or it invokesOutlet.recohereInput(int)
, if its input is not aMapOutlet
. Then, if all decoherent keys have been recohered, theMapInlet
invokesStreamlet.recohere(int)
on its attached streamlet.- Specified by:
recohereOutputKey
in interfaceMapInlet<K,V,O>
-
recohereOutput
public void recohereOutput(int version)
Description copied from interface:Inlet
Updates the state of thisInlet
to make it consistent with thetarget
version. TheInlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theInlet
first invokesOutlet.recohereInput(int)
on itsinput
, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)
on theStreamlet
to which it's attached, causing theStreamlet
to make its own state coherent again.- Specified by:
recohereOutput
in interfaceInlet<K>
-
willDecohereOutput
protected void willDecohereOutput()
-
onDecohereOutput
protected void onDecohereOutput()
-
didDecohereOutput
protected void didDecohereOutput()
-
willRecohereOutput
protected void willRecohereOutput(int version)
-
onRecohereOutput
protected void onRecohereOutput(int version)
-
didRecohereOutput
protected void didRecohereOutput(int version)
-
-