- java.lang.Object
-
- swim.streamlet.AbstractInoutlet<I,O>
-
- Direct Known Subclasses:
MapValueOperator,MemoizeValueCombinator,StreamletInoutlet
public abstract class AbstractInoutlet<I,O> extends Object implements Inoutlet<I,O>
-
-
Constructor Summary
Constructors Constructor Description AbstractInoutlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbindInput(Outlet<? extends I> input)Connects thisInletto anOutletfrom which it will acquire its state.voidbindOutput(Inlet<? super O> output)Adds anoutputto the set ofInlets that depend on the state of thisOutlet.voiddecohere()voiddecohereInput()Marks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voiddecohereOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state.protected voiddidDecohere()protected voiddidRecohere(int version)voiddisconnectInputs()Disconnects allInlets dominated by thisInoutletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allInletss dominated by thisInoutletin the dataflow graph.abstract Oget()Returns the current state of thisOutlet.Outlet<? extends I>input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.protected voidonDecohere()protected voidonRecohere(int version)Iterator<Inlet<? super O>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidrecohere(int version)voidrecohereInput(int version)Updates the state of thisOutletto make it consistent with the targetversion.voidrecohereOutput(int version)Updates the state of thisInletto make it consistent with thetargetversion.voidunbindInput()Disconnects thisInletfrom its inputOutlet, if connected.voidunbindOutput(Inlet<? super O> output)Removes anoutputfrom the set ofInlets that depend on the state of thisOutlet.voidunbindOutputs()Disconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.protected voidwillDecohere()protected voidwillRecohere(int version)
-
-
-
Method Detail
-
get
public abstract O get()
Description copied from interface:OutletReturns the current state of thisOutlet.
-
input
public Outlet<? extends I> input()
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.
-
bindInput
public void bindInput(Outlet<? extends I> input)
Description copied from interface:InletConnects thisInletto anOutletfrom which it will acquire its state. If thisInletis already connected, it will first disconnect from its existing input. Then, after updating itsinputproperty, theInletwill invokeOutlet.bindOutput(Inlet)on its newinput.
-
unbindInput
public void unbindInput()
Description copied from interface:InletDisconnects thisInletfrom its inputOutlet, if connected. After setting itsinputproperty tonull, theInletwill invokeOutlet.unbindOutput(Inlet)on its old input, if defined.- Specified by:
unbindInputin interfaceInlet<I>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:InoutletDisconnects allInlets dominated by thisInoutletin the dataflow dependency graph. Used to recursively clean up chains of combinators passing through thisInoutlet.- Specified by:
disconnectInputsin interfaceInlet<I>- Specified by:
disconnectInputsin interfaceInoutlet<I,O>- Specified by:
disconnectInputsin interfaceOutlet<I>
-
outputIterator
public Iterator<Inlet<? super O>> outputIterator()
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<I>
-
bindOutput
public void bindOutput(Inlet<? super O> output)
Description copied from interface:OutletAdds anoutputto the set ofInlets that depend on the state of thisOutlet. Theoutputwill be decohered when the state of thisOutletis decohered, and recohered when thisOutletis recohered.- Specified by:
bindOutputin interfaceOutlet<I>
-
unbindOutput
public void unbindOutput(Inlet<? super O> output)
Description copied from interface:OutletRemoves anoutputfrom the set ofInlets that depend on the state of thisOutlet.- Specified by:
unbindOutputin interfaceOutlet<I>
-
unbindOutputs
public void unbindOutputs()
Description copied from interface:OutletDisconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.- Specified by:
unbindOutputsin interfaceOutlet<I>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:InoutletDisconnects allInletss dominated by thisInoutletin the dataflow graph. Used to recursively clean up chains of combinators passing through thisInoutlet.- Specified by:
disconnectOutputsin interfaceInlet<I>- Specified by:
disconnectOutputsin interfaceInoutlet<I,O>- Specified by:
disconnectOutputsin interfaceOutlet<I>
-
decohereOutput
public void decohereOutput()
Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state. Decohering anInletwill recursively decohere all streamlets that transitively depend on the state of thisInlet. Decohering anInletdoes not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)call will eventually make the state of theInletcoherent again.- Specified by:
decohereOutputin interfaceInlet<I>
-
decohereInput
public void decohereInput()
Description copied from interface:OutletMarks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.- Specified by:
decohereInputin interfaceOutlet<I>
-
decohere
public void decohere()
-
recohereOutput
public void recohereOutput(int version)
Description copied from interface:InletUpdates the state of thisInletto make it consistent with thetargetversion. TheInletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theInletfirst invokesOutlet.recohereInput(int)on itsinput, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)on theStreamletto which it's attached, causing theStreamletto make its own state coherent again.- Specified by:
recohereOutputin interfaceInlet<I>
-
recohereInput
public void recohereInput(int version)
Description copied from interface:OutletUpdates the state of thisOutletto make it consistent with the targetversion. TheOutletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theOutletfirst invokesStreamlet.recohere(int)on theStreamletto which it's attached. It then invokesInlet.recohereOutput(int)on each of its dependentoutputs.- Specified by:
recohereInputin 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)
-
-