- java.lang.Object
-
- swim.streamlet.AbstractMapOutlet<K,V,O>
-
-
Constructor Summary
Constructors Constructor Description AbstractMapOutlet()
-
Method Summary
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.protected voiddidInvalidateInput()protected voiddidInvalidateInputKey(K key, KeyEffect effect)protected voiddidReconcileInput(int version)protected voiddidReconcileInputKey(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.voidinvalidateInput()voidinvalidateInputKey(K key, KeyEffect effect)Marks thisMapOutletas needing aneffectapplied to a givenkey.abstract Iterator<K>keyIterator()Returns anIteratorover the keys in the current state of thisMapOutlet.protected voidonInvalidateInput()protected voidonInvalidateInputKey(K key, KeyEffect effect)protected voidonReconcileInput(int version)protected voidonReconcileInputKey(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.voidreconcileInput(int version)Reconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion.voidreconcileInputKey(K key, int version)Reconciles the state of an individualkeyin thisMapOutlet, if the version of thisMapOutlet's state differs from 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 voidwillInvalidateInput()protected voidwillInvalidateInputKey(K key, KeyEffect effect)protected voidwillReconcileInput(int version)protected voidwillReconcileInputKey(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 invalidated when the state of thisOutletis invalidated, and updated when thisOutletis updated.- 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>
-
invalidateInputKey
public void invalidateInputKey(K key, KeyEffect effect)
Description copied from interface:MapOutletMarks thisMapOutletas needing aneffectapplied to a givenkey. Invalidating an individual key invalidates the entire state of theOutlet. But only the invalidated keys need to be updated in order to reconcile the overall state of theOutlet.- Specified by:
invalidateInputKeyin interfaceMapOutlet<K,V,O>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet- Specified by:
invalidateInputin interfaceOutlet<K>
-
reconcileInputKey
public void reconcileInputKey(K key, int version)
Description copied from interface:MapOutletReconciles the state of an individualkeyin thisMapOutlet, if the version of thisMapOutlet's state differs from the targetversion. To reconcile the state of a key, theMapOutletfirst invokesStreamlet.reconcile(int)on its attached streamlets. Then, for each dependent output, it invokesMapInlet.reconcileOutputKey(Object, int), if the dependent output is aMapInlet, or it invokesInlet.reconcileOutput(int), if the dependent output is not aMapInlet.- Specified by:
reconcileInputKeyin interfaceMapOutlet<K,V,O>
-
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<K>
-
willInvalidateInput
protected void willInvalidateInput()
-
onInvalidateInput
protected void onInvalidateInput()
-
didInvalidateInput
protected void didInvalidateInput()
-
willReconcileInput
protected void willReconcileInput(int version)
-
onReconcileInput
protected void onReconcileInput(int version)
-
didReconcileInput
protected void didReconcileInput(int version)
-
-