java.lang.Object
swim.streamlet.AbstractInoutlet<I,O>
- Direct Known Subclasses:
MapValueOperator
,MemoizeValueCombinator
,StreamletInoutlet
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Connects thisInlet
to anOutlet
from which it will acquire its state.void
bindOutput
(Inlet<? super O> output) Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
.void
decohere()
void
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.void
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state.protected void
protected void
didRecohere
(int version) void
Disconnects allInlet
s dominated by thisInoutlet
in the dataflow dependency graph.void
Disconnects allInlets
s dominated by thisInoutlet
in the dataflow graph.abstract O
get()
Returns the current state of thisOutlet
.input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.protected void
protected void
onRecohere
(int version) Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.void
recohere
(int version) void
recohereInput
(int version) Updates the state of thisOutlet
to make it consistent with the targetversion
.void
recohereOutput
(int version) Updates the state of thisInlet
to make it consistent with thetarget
version.void
Disconnects thisInlet
from its inputOutlet
, if connected.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
willRecohere
(int version)
-
Field Details
-
input
-
outputs
-
version
protected int version
-
-
Constructor Details
-
AbstractInoutlet
public AbstractInoutlet()
-
-
Method Details
-
get
Description copied from interface:Outlet
Returns the current state of thisOutlet
. -
input
Description copied from interface:Inlet
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected. -
bindInput
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<I>
-
disconnectInputs
public void disconnectInputs()Description copied from interface:Inoutlet
Disconnects allInlet
s dominated by thisInoutlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators passing through thisInoutlet
.- Specified by:
disconnectInputs
in interfaceInlet<I>
- Specified by:
disconnectInputs
in interfaceInoutlet<I,
O> - Specified by:
disconnectInputs
in interfaceOutlet<I>
-
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<I>
-
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<I>
-
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<I>
-
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<I>
-
disconnectOutputs
public void disconnectOutputs()Description copied from interface:Inoutlet
Disconnects allInlets
s dominated by thisInoutlet
in the dataflow graph. Used to recursively clean up chains of combinators passing through thisInoutlet
.- Specified by:
disconnectOutputs
in interfaceInlet<I>
- Specified by:
disconnectOutputs
in interfaceInoutlet<I,
O> - Specified by:
disconnectOutputs
in interfaceOutlet<I>
-
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<I>
-
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<I>
-
decohere
public void decohere() -
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<I>
-
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<I>
-
recohere
public void recohere(int version) -
willDecohere
protected void willDecohere() -
onDecohere
protected void onDecohere() -
didDecohere
protected void didDecohere() -
willRecohere
protected void willRecohere(int version) -
onRecohere
protected void onRecohere(int version) -
didRecohere
protected void didRecohere(int version)
-