- java.lang.Object
-
- swim.streamlet.AbstractMapInoutlet<K,V,V,IO,IO>
-
- swim.streamlet.combinator.MemoizeMapCombinator<K,V,IO>
-
- All Implemented Interfaces:
Inlet<IO>
,Inoutlet<IO,IO>
,MapInlet<K,V,IO>
,MapInoutlet<K,V,V,IO,IO>
,MapOutlet<K,V,IO>
,Outlet<IO>
public class MemoizeMapCombinator<K,V,IO> extends AbstractMapInoutlet<K,V,V,IO,IO>
-
-
Constructor Summary
Constructors Constructor Description MemoizeMapCombinator()
-
Method Summary
Modifier and Type Method Description boolean
containsKey(K key)
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.IO
get()
Returns the current state of thisOutlet
.V
get(K key)
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
.Iterator<K>
keyIterator()
Returns anIterator
over the keys in the current state of thisMapOutlet
.MapOutlet<K,V,IO>
memoize()
protected void
onReconcile(int version)
protected void
onReconcileKey(K key, KeyEffect effect, int version)
-
Methods inherited from class swim.streamlet.AbstractMapInoutlet
bindInput, bindInput, bindOutput, didInvalidate, didInvalidateKey, didReconcile, didReconcileKey, disconnectInputs, disconnectOutputs, input, invalidate, invalidateInput, invalidateInputKey, invalidateKey, invalidateOutput, invalidateOutputKey, onInvalidate, onInvalidateKey, outlet, outputIterator, reconcile, reconcileInput, reconcileInputKey, reconcileKey, reconcileOutput, reconcileOutputKey, unbindInput, unbindOutput, unbindOutputs, willInvalidate, willInvalidateKey, willReconcile, willReconcileKey
-
-
-
-
Field Detail
-
state
protected IO state
-
cache
protected HashTrieMap<K,V> cache
-
-
Method Detail
-
containsKey
public boolean containsKey(K key)
Description copied from interface:MapOutlet
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.- Specified by:
containsKey
in interfaceMapOutlet<K,V,IO>
- Specified by:
containsKey
in classAbstractMapInoutlet<K,V,V,IO,IO>
-
get
public V get(K key)
Description copied from interface:MapOutlet
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
.
-
get
public IO get()
Description copied from interface:Outlet
Returns the current state of thisOutlet
.
-
keyIterator
public Iterator<K> keyIterator()
Description copied from interface:MapOutlet
Returns anIterator
over the keys in the current state of thisMapOutlet
.- Specified by:
keyIterator
in interfaceMapOutlet<K,V,IO>
- Specified by:
keyIterator
in classAbstractMapInoutlet<K,V,V,IO,IO>
-
onReconcileKey
protected void onReconcileKey(K key, KeyEffect effect, int version)
- Overrides:
onReconcileKey
in classAbstractMapInoutlet<K,V,V,IO,IO>
-
onReconcile
protected void onReconcile(int version)
- Overrides:
onReconcile
in classAbstractMapInoutlet<K,V,V,IO,IO>
-
-