- java.lang.Object
-
- swim.streamlet.AbstractInlet<I>
-
- All Implemented Interfaces:
Inlet<I>
- Direct Known Subclasses:
OutletInlet
,RecordFieldUpdater
,StreamletInlet
,ValueOutput
,WatchValueOperator
public abstract class AbstractInlet<I> extends Object implements Inlet<I>
-
-
Constructor Summary
Constructors Constructor Description AbstractInlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindInput(Outlet<? extends I> 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.protected void
didDecohereOutput()
protected void
didRecohereOutput(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.Outlet<? extends I>
input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.protected void
onDecohereOutput()
protected void
onRecohereOutput(int version)
void
recohereOutput(int version)
Updates the state of thisInlet
to make it consistent with thetarget
version.void
unbindInput()
Disconnects thisInlet
from its inputOutlet
, if connected.protected void
willDecohereOutput()
protected void
willRecohereOutput(int version)
-
-
-
Method Detail
-
input
public Outlet<? extends I> 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 I> 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<I>
-
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<I>
-
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<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>
-
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>
-
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)
-
-