java.lang.Object
swim.streamlet.AbstractMapOutlet<K,V,O>
- Direct Known Subclasses:
MapInput
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindOutput
(Inlet<? super O> output) Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
.abstract boolean
containsKey
(K key) Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.void
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.void
decohereInputKey
(K key, KeyEffect effect) Marks thisMapOutlet
as needing aneffect
applied to a givenkey
.protected void
protected void
didDecohereInputKey
(K key, KeyEffect effect) protected void
didRecohereInput
(int version) protected void
didRecohereInputKey
(K key, KeyEffect effect, int version) void
Disconnects allInlet
s dominated by thisOutlet
in the dataflow dependency graph.void
Disconnects allOutlet
s dominated by thisOutlet
in the dataflow graph.abstract O
get()
Returns the current state of thisOutlet
.abstract V
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
.Returns anIterator
over the keys in the current state of thisMapOutlet
.protected void
protected void
onDecohereInputKey
(K key, KeyEffect effect) protected void
onRecohereInput
(int version) protected void
onRecohereInputKey
(K key, KeyEffect effect, int version) Returns anOutlet
that updates when the specifiedkey
updates.Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.void
recohereInput
(int version) Updates the state of thisOutlet
to make it consistent with the targetversion
.void
recohereInputKey
(K key, int version) Updates the state of an individualkey
in thisMapOutlet
to make it consistent with the targetversion
.void
unbindOutput
(Inlet<? super O> output) Removes anoutput
from the set ofInlet
s that depend on the state of thisOutlet
.void
Disconnects all outputs from thisOutlet
by invokingInlet.unbindInput()
on eachInelt
that depends on the state of thisOutlet
.protected void
protected void
willDecohereInputKey
(K key, KeyEffect effect) protected void
willRecohereInput
(int version) protected void
willRecohereInputKey
(K key, KeyEffect effect, int version)
-
Field Details
-
effects
-
outlets
-
outputs
-
version
protected int version
-
-
Constructor Details
-
AbstractMapOutlet
public AbstractMapOutlet()
-
-
Method Details
-
containsKey
Description copied from interface:MapOutlet
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.- Specified by:
containsKey
in interfaceMapOutlet<K,
V, O>
-
get
Description copied from interface:MapOutlet
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
. -
get
Description copied from interface:Outlet
Returns the current state of thisOutlet
. -
keyIterator
Description copied from interface:MapOutlet
Returns anIterator
over the keys in the current state of thisMapOutlet
.- Specified by:
keyIterator
in interfaceMapOutlet<K,
V, O>
-
outlet
Description copied from interface:MapOutlet
Returns anOutlet
that updates when the specifiedkey
updates. -
outputIterator
Description copied from interface:Outlet
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.- Specified by:
outputIterator
in interfaceOutlet<K>
-
bindOutput
Description copied from interface:Outlet
Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
. Theoutput
will be decohered when the state of thisOutlet
is decohered, and recohered when thisOutlet
is recohered.- Specified by:
bindOutput
in interfaceOutlet<K>
-
unbindOutput
Description copied from interface:Outlet
Removes anoutput
from the set ofInlet
s that depend on the state of thisOutlet
.- Specified by:
unbindOutput
in interfaceOutlet<K>
-
unbindOutputs
public void unbindOutputs()Description copied from interface:Outlet
Disconnects all outputs from thisOutlet
by invokingInlet.unbindInput()
on eachInelt
that depends on the state of thisOutlet
.- Specified by:
unbindOutputs
in interfaceOutlet<K>
-
disconnectOutputs
public void disconnectOutputs()Description copied from interface:Outlet
Disconnects allOutlet
s dominated by thisOutlet
in the dataflow graph. Used to recursively clean up chains of combinators originating from thisInlet
.- Specified by:
disconnectOutputs
in interfaceOutlet<K>
-
disconnectInputs
public void disconnectInputs()Description copied from interface:Outlet
Disconnects allInlet
s dominated by thisOutlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators passing through thisOutlet
.- Specified by:
disconnectInputs
in interfaceOutlet<K>
-
decohereInputKey
Description copied from interface:MapOutlet
Marks thisMapOutlet
as needing aneffect
applied to a givenkey
. Decohering an individual key decoheres the entire state of theOutlet
. But only the decoherent keys need to be updated in order to recohere the overall state of theOutlet
.- Specified by:
decohereInputKey
in interfaceMapOutlet<K,
V, O>
-
decohereInput
public void decohereInput()Description copied from interface:Outlet
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.- Specified by:
decohereInput
in interfaceOutlet<K>
-
recohereInputKey
Description copied from interface:MapOutlet
Updates the state of an individualkey
in thisMapOutlet
to make it consistent with the targetversion
. TheMapOutlet
only needs to update if its currentversion
differs from the targetversion
. To update the state of a key, theMapOutlet
first invokesStreamlet.recohere(int)
on its attached streamlets. Then, for each dependent output, it invokesMapInlet.recohereOutputKey(Object, int)
, if the dependent output is aMapInlet
, or it invokesInlet.recohereOutput(int)
, if the dependent output is not aMapInlet
.- Specified by:
recohereInputKey
in interfaceMapOutlet<K,
V, O>
-
recohereInput
public void recohereInput(int version) Description copied from interface:Outlet
Updates the state of thisOutlet
to make it consistent with the targetversion
. TheOutlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theOutlet
first invokesStreamlet.recohere(int)
on theStreamlet
to which it's attached. It then invokesInlet.recohereOutput(int)
on each of its dependentoutputs
.- Specified by:
recohereInput
in interfaceOutlet<K>
-
willDecohereInputKey
-
onDecohereInputKey
-
didDecohereInputKey
-
willDecohereInput
protected void willDecohereInput() -
onDecohereInput
protected void onDecohereInput() -
didDecohereInput
protected void didDecohereInput() -
willRecohereInputKey
-
onRecohereInputKey
-
didRecohereInputKey
-
willRecohereInput
protected void willRecohereInput(int version) -
onRecohereInput
protected void onRecohereInput(int version) -
didRecohereInput
protected void didRecohereInput(int version)
-