- 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
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.protected voiddidInvalidate()protected voiddidReconcile(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.voidinvalidate()voidinvalidateInput()voidinvalidateOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having stale state.protected voidonInvalidate()protected voidonReconcile(int version)Iterator<Inlet<? super O>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidreconcile(int version)voidreconcileInput(int version)Reconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion.voidreconcileOutput(int version)Reconciles the state of thisInlet, if the version of thisInlet's state differs from the targetversion.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 voidwillInvalidate()protected voidwillReconcile(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 invalidated when the state of thisOutletis invalidated, and updated when thisOutletis updated.- 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>
-
invalidateOutput
public void invalidateOutput()
Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having stale state. Invalidating anInletwill recursively invalidate all streamlets that transitively depend on the state of thisInlet. Invalidating anInletdoes not cause its state to be recomputed. A subsequentInlet.reconcileOutput(int)call will reconcile the state of theInlet.- Specified by:
invalidateOutputin interfaceInlet<I>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet- Specified by:
invalidateInputin interfaceOutlet<I>
-
invalidate
public void invalidate()
-
reconcileOutput
public void reconcileOutput(int version)
Description copied from interface:InletReconciles the state of thisInlet, if the version of thisInlet's state differs from the targetversion. To reconcile its state, theInletfirst invokesOutlet.reconcileInput(int)on itsinput, to ensure that its input is up-to-date. It then invokesStreamlet.reconcile(int)on theStreamletto which it's attached, causing theStreamletto reconcile its own state.- Specified by:
reconcileOutputin interfaceInlet<I>
-
reconcileInput
public void reconcileInput(int version)
Description copied from interface:OutletReconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion. To reconcile its state, theOutletfirst invokesStreamlet.reconcile(int)on theStreamletto which it's attached. It then invokesInlet.reconcileOutput(int)on each of its dependentoutputs.- Specified by:
reconcileInputin interfaceOutlet<I>
-
reconcile
public void reconcile(int version)
-
willInvalidate
protected void willInvalidate()
-
onInvalidate
protected void onInvalidate()
-
didInvalidate
protected void didInvalidate()
-
willReconcile
protected void willReconcile(int version)
-
onReconcile
protected void onReconcile(int version)
-
didReconcile
protected void didReconcile(int version)
-
-