java.lang.Object
swim.streamlet.AbstractMapInoutlet<K,VI,VO,I,O>
- All Implemented Interfaces:
Inlet<I>,Inoutlet<I,,O> MapInlet<K,,VI, I> MapInoutlet<K,,VI, VO, I, O> MapOutlet<K,,VO, O> Outlet<O>
- Direct Known Subclasses:
MapFieldValuesOperator,MemoizeMapCombinator
public abstract class AbstractMapInoutlet<K,VI,VO,I,O>
extends Object
implements MapInoutlet<K,VI,VO,I,O>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidConnects 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.abstract booleancontainsKey(K key) Returnstrueif the current state of thisMapOutletcontains the givenkey; otherwise returnsfalse.voiddecohere()voidMarks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voiddecohereInputKey(K key, KeyEffect effect) Marks thisMapOutletas needing aneffectapplied to a givenkey.voiddecohereKey(K key, KeyEffect effect) voidMarks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state.voiddecohereOutputKey(K key, KeyEffect effect) Marks thisMapInletas needing aneffectapplied to a givenkey.protected voidprotected voiddidDecohereKey(K key, KeyEffect effect) protected voiddidRecohere(int version) protected voiddidRecohereKey(K key, KeyEffect effect, int version) voidDisconnects allInlets dominated by thisInoutletin the dataflow dependency graph.voidDisconnects allInletss dominated by thisInoutletin the dataflow graph.abstract Oget()Returns the current state of thisOutlet.abstract VOReturns the value assocaited with the givenkeyin the current state of thisMapOutlet, if defined; otherwise returnsnull.input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.Returns anIteratorover the keys in the current state of thisMapOutlet.protected voidprotected voidonDecohereKey(K key, KeyEffect effect) protected voidonRecohere(int version) protected voidonRecohereKey(K key, KeyEffect effect, int version) Returns anOutletthat updates when the specifiedkeyupdates.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.voidrecohereInputKey(K key, int version) Updates the state of an individualkeyin thisMapOutletto make it consistent with the targetversion.voidrecohereKey(K key, int version) voidrecohereOutput(int version) Updates the state of thisInletto make it consistent with thetargetversion.voidrecohereOutputKey(K key, int version) Updates the state of an individualkeyin thisMapInletto make it consistent with the targetversion.voidDisconnects thisInletfrom its inputOutlet, if connected.voidunbindOutput(Inlet<? super O> output) Removes anoutputfrom the set ofInlets that depend on the state of thisOutlet.voidDisconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.protected voidprotected voidwillDecohereKey(K key, KeyEffect effect) protected voidwillRecohere(int version) protected voidwillRecohereKey(K key, KeyEffect effect, int version)
-
Field Details
-
input
-
effects
-
outlets
-
outputs
-
version
protected int version
-
-
Constructor Details
-
AbstractMapInoutlet
public AbstractMapInoutlet()
-
-
Method Details
-
containsKey
Description copied from interface:MapOutletReturnstrueif the current state of thisMapOutletcontains the givenkey; otherwise returnsfalse.- Specified by:
containsKeyin interfaceMapOutlet<K,VI, VO>
-
get
Description copied from interface:MapOutletReturns the value assocaited with the givenkeyin the current state of thisMapOutlet, if defined; otherwise returnsnull. -
get
Description copied from interface:OutletReturns the current state of thisOutlet. -
keyIterator
Description copied from interface:MapOutletReturns anIteratorover the keys in the current state of thisMapOutlet.- Specified by:
keyIteratorin interfaceMapOutlet<K,VI, VO>
-
input
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected. -
bindInput
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. -
bindInput
-
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<K>
-
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<K>- Specified by:
disconnectInputsin interfaceInoutlet<K,VI> - Specified by:
disconnectInputsin interfaceOutlet<K>
-
outlet
Description copied from interface:MapOutletReturns anOutletthat updates when the specifiedkeyupdates. -
outputIterator
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<K>
-
bindOutput
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<K>
-
unbindOutput
Description copied from interface:OutletRemoves anoutputfrom the set ofInlets that depend on the state of thisOutlet.- Specified by:
unbindOutputin interfaceOutlet<K>
-
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<K>
-
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<K>- Specified by:
disconnectOutputsin interfaceInoutlet<K,VI> - Specified by:
disconnectOutputsin interfaceOutlet<K>
-
decohereOutputKey
Description copied from interface:MapInletMarks thisMapInletas needing aneffectapplied to a givenkey. Decohering an individual key decoheres the entire state of theInlet. But only the decoherent keys need to be updated in order to recohere the overall state of theInlet.- Specified by:
decohereOutputKeyin interfaceMapInlet<K,VI, VO>
-
decohereInputKey
Description copied from interface:MapOutletMarks thisMapOutletas needing aneffectapplied 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:
decohereInputKeyin interfaceMapOutlet<K,VI, VO>
-
decohereKey
-
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<K>
-
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<K>
-
decohere
public void decohere() -
recohereOutputKey
Description copied from interface:MapInletUpdates the state of an individualkeyin thisMapInletto make it consistent with the targetversion. TheMapInletonly needs to update if the currentversiondiffers from the targetversion. To update the state of a key, theMapInletfirst invokesMapOutlet.recohereInputKey(Object, int)on itsinput, if its input is aMapOutlet, or it invokesOutlet.recohereInput(int), if its input is not aMapOutlet. Then, if all decoherent keys have been recohered, theMapInletinvokesStreamlet.recohere(int)on its attached streamlet.- Specified by:
recohereOutputKeyin interfaceMapInlet<K,VI, VO>
-
recohereInputKey
Description copied from interface:MapOutletUpdates the state of an individualkeyin thisMapOutletto make it consistent with the targetversion. TheMapOutletonly needs to update if its currentversiondiffers from the targetversion. To update the state of a key, theMapOutletfirst 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:
recohereInputKeyin interfaceMapOutlet<K,VI, VO>
-
recohereKey
-
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<K>
-
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<K>
-
recohere
public void recohere(int version) -
willDecohereKey
-
onDecohereKey
-
didDecohereKey
-
willDecohere
protected void willDecohere() -
onDecohere
protected void onDecohere() -
didDecohere
protected void didDecohere() -
willRecohereKey
-
onRecohereKey
-
didRecohereKey
-
willRecohere
protected void willRecohere(int version) -
onRecohere
protected void onRecohere(int version) -
didRecohere
protected void didRecohere(int version)
-