- java.lang.Object
-
- swim.streamlet.AbstractMapOutlet<K,V,O>
-
-
Constructor Summary
Constructors Constructor Description AbstractMapOutlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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.voiddecohereInput()Marks 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.protected voiddidDecohereInput()protected voiddidDecohereInputKey(K key, KeyEffect effect)protected voiddidRecohereInput(int version)protected voiddidRecohereInputKey(K key, KeyEffect effect, int version)voiddisconnectInputs()Disconnects allInlets dominated by thisOutletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allOutlets dominated by thisOutletin the dataflow graph.abstract Oget()Returns the current state of thisOutlet.abstract Vget(K key)Returns the value assocaited with the givenkeyin the current state of thisMapOutlet, if defined; otherwise returnsnull.abstract Iterator<K>keyIterator()Returns anIteratorover the keys in the current state of thisMapOutlet.protected voidonDecohereInput()protected voidonDecohereInputKey(K key, KeyEffect effect)protected voidonRecohereInput(int version)protected voidonRecohereInputKey(K key, KeyEffect effect, int version)Outlet<V>outlet(K key)Returns anOutletthat updates when the specifiedkeyupdates.Iterator<Inlet<? super O>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.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.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 voidwillDecohereInput()protected voidwillDecohereInputKey(K key, KeyEffect effect)protected voidwillRecohereInput(int version)protected voidwillRecohereInputKey(K key, KeyEffect effect, int version)
-
-
-
Field Detail
-
effects
protected HashTrieMap<K,KeyEffect> effects
-
outlets
protected HashTrieMap<K,KeyOutlet<K,V>> outlets
-
version
protected int version
-
-
Method Detail
-
containsKey
public abstract boolean containsKey(K key)
Description copied from interface:MapOutletReturnstrueif the current state of thisMapOutletcontains the givenkey; otherwise returnsfalse.- Specified by:
containsKeyin interfaceMapOutlet<K,V,O>
-
get
public abstract V get(K key)
Description copied from interface:MapOutletReturns the value assocaited with the givenkeyin the current state of thisMapOutlet, if defined; otherwise returnsnull.
-
get
public abstract O get()
Description copied from interface:OutletReturns the current state of thisOutlet.
-
keyIterator
public abstract Iterator<K> keyIterator()
Description copied from interface:MapOutletReturns anIteratorover the keys in the current state of thisMapOutlet.- Specified by:
keyIteratorin interfaceMapOutlet<K,V,O>
-
outlet
public Outlet<V> outlet(K key)
Description copied from interface:MapOutletReturns anOutletthat updates when the specifiedkeyupdates.
-
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<K>
-
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<K>
-
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<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:OutletDisconnects allOutlets dominated by thisOutletin the dataflow graph. Used to recursively clean up chains of combinators originating from thisInlet.- Specified by:
disconnectOutputsin interfaceOutlet<K>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:OutletDisconnects allInlets dominated by thisOutletin the dataflow dependency graph. Used to recursively clean up chains of combinators passing through thisOutlet.- Specified by:
disconnectInputsin interfaceOutlet<K>
-
decohereInputKey
public void decohereInputKey(K key, KeyEffect effect)
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,V,O>
-
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>
-
recohereInputKey
public void recohereInputKey(K key, int version)
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,V,O>
-
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>
-
willDecohereInput
protected void willDecohereInput()
-
onDecohereInput
protected void onDecohereInput()
-
didDecohereInput
protected void didDecohereInput()
-
willRecohereInput
protected void willRecohereInput(int version)
-
onRecohereInput
protected void onRecohereInput(int version)
-
didRecohereInput
protected void didRecohereInput(int version)
-
-