- java.lang.Object
-
- swim.runtime.lane.LaneView
-
- swim.runtime.lane.MapLaneView<K,V>
-
- All Implemented Interfaces:
Iterable<Map.Entry<K,V>>,Map<K,V>,SortedMap<K,V>,swim.api.http.HttpLane<Object>,swim.api.lane.Lane,swim.api.lane.MapLane<K,V>,swim.observable.Observable<Object>,swim.observable.ObservableIterableMap<K,V>,swim.observable.ObservableMap<K,V>,swim.observable.ObservableOrderedMap<K,V>,swim.observable.ObservableSortedMap<K,V>,swim.streamlet.Inlet<Map<K,V>>,swim.streamlet.MapInlet<K,V,Map<K,V>>,swim.streamlet.MapOutlet<K,V,swim.api.lane.MapLane<K,V>>,swim.streamlet.Outlet<swim.api.lane.MapLane<K,V>>,swim.util.IterableMap<K,V>,swim.util.Log,swim.util.OrderedMap<K,V>
public class MapLaneView<K,V> extends LaneView implements swim.api.lane.MapLane<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected swim.api.agent.AgentContextagentContextprotected swim.api.data.MapData<K,V>dataViewprotected swim.collections.HashTrieMap<K,swim.streamlet.KeyEffect>effectsprotected intflagsprotected swim.streamlet.MapOutlet<K,V,? extends Map<K,V>>inputprotected swim.structure.Form<K>keyFormprotected MapLaneModellaneBindingprotected swim.collections.HashTrieMap<K,swim.streamlet.KeyOutlet<K,V>>outletsprotected swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>>[]outputsprotected swim.structure.Form<V>valueFormprotected intversion
-
Constructor Summary
Constructors Constructor Description MapLaneView(swim.api.agent.AgentContext agentContext, swim.structure.Form<K> keyForm, swim.structure.Form<V> valueForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description swim.api.agent.AgentContextagentContext()voidbindInput(swim.streamlet.MapOutlet<K,V,? extends Map<K,V>> input)voidbindInput(swim.streamlet.Outlet<? extends Map<K,V>> input)voidbindOutput(swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>> output)voidclear()voidclose()Comparator<? super K>comparator()booleancontainsKey(Object key)booleancontainsValue(Object value)MapLaneModelcreateLaneBinding()MapLaneView<K,V>decodeRequest(swim.api.http.function.DecodeRequestHttp<Object> decodeRequest)MapLaneView<K,V>didClear(swim.observable.function.DidClear didClear)MapLaneView<K,V>didCommand(swim.api.lane.function.DidCommand didCommand)MapLaneView<K,V>didDrop(swim.observable.function.DidDrop didDrop)MapLaneView<K,V>didEnter(swim.api.lane.function.DidEnter didEnter)protected voiddidInvalidate()protected voiddidInvalidateKey(K key, swim.streamlet.KeyEffect effect)MapLaneView<K,V>didLeave(swim.api.lane.function.DidLeave didLeave)protected voiddidReconcile(int version)protected voiddidReconcileKey(K key, swim.streamlet.KeyEffect effect, int version)MapLaneView<K,V>didRemove(swim.observable.function.DidRemoveKey<K,V> didRemove)MapLaneView<K,V>didRequest(swim.api.http.function.DidRequestHttp<Object> didRequest)MapLaneView<K,V>didRespond(swim.api.http.function.DidRespondHttp<?> didRespond)MapLaneView<K,V>didTake(swim.observable.function.DidTake didTake)protected voiddidUpdate(int version)MapLaneView<K,V>didUpdate(swim.observable.function.DidUpdateKey<K,V> didUpdate)MapLaneView<K,V>didUplink(swim.api.lane.function.DidUplink didUplink)voiddisconnectInputs()voiddisconnectOutputs()protected booleandispatchDidClear(swim.api.Link link, boolean preemptive)protected booleandispatchDidDrop(swim.api.Link link, int lower, boolean preemptive)protected booleandispatchDidRemove(swim.api.Link link, K key, V oldValue, boolean preemptive)protected booleandispatchDidTake(swim.api.Link link, int upper, boolean preemptive)protected booleandispatchDidUpdate(swim.api.Link link, K key, V newValue, V oldValue, boolean preemptive)protected booleandispatchWillClear(swim.api.Link link, boolean preemptive)protected booleandispatchWillDrop(swim.api.Link link, int lower, boolean preemptive)protected booleandispatchWillRemove(swim.api.Link link, K key, boolean preemptive)protected booleandispatchWillTake(swim.api.Link link, int upper, boolean preemptive)protected Map.Entry<Boolean,V>dispatchWillUpdate(swim.api.Link link, K key, V newValue, boolean preemptive)MapLaneView<K,V>doRespond(swim.api.http.function.DoRespondHttp<Object> doRespond)voiddrop(int lower)Set<Map.Entry<K,V>>entrySet()Map.Entry<K,V>firstEntry()KfirstKey()VfirstValue()swim.api.lane.MapLane<K,V>get()Vget(Object key)Map.Entry<K,V>getEntry(Object key)Map.Entry<K,V>getIndex(int index)MapLaneModelgetLaneBinding()swim.util.OrderedMap<K,V>headMap(K toKey)intindexOf(Object key)swim.streamlet.MapOutlet<K,V,? extends Map<K,V>>input()voidinvalidate()voidinvalidateInput()voidinvalidateInputKey(K key, swim.streamlet.KeyEffect effect)voidinvalidateKey(K key, swim.streamlet.KeyEffect effect)voidinvalidateOutput()voidinvalidateOutputKey(K key, swim.streamlet.KeyEffect effect)booleanisEmpty()booleanisResident()MapLaneView<K,V>isResident(boolean isResident)booleanisSigned()MapLaneView<K,V>isSigned(boolean isSigned)booleanisTransient()MapLaneView<K,V>isTransient(boolean isTransient)swim.util.OrderedMapCursor<K,V>iterator()<K2> MapLaneView<K2,V>keyClass(Class<K2> keyClass)swim.structure.Form<K>keyForm()<K2> MapLaneView<K2,V>keyForm(swim.structure.Form<K2> keyForm)swim.util.Cursor<K>keyIterator()Set<K>keySet()voidlaneDidClear()voidlaneDidDrop(int lower)voidlaneDidRemove(K key, V oldValue)voidlaneDidTake(int upper)voidlaneDidUpdate(K key, V newValue, V oldValue)voidlaneWillClear()voidlaneWillDrop(int lower)voidlaneWillRemove(K key)voidlaneWillTake(int upper)VlaneWillUpdate(K key, V newValue)Map.Entry<K,V>lastEntry()KlastKey()VlastValue()Map.Entry<K,V>nextEntry(K key)KnextKey(K key)VnextValue(K key)MapLaneView<K,V>observe(Object observer)protected voidonInvalidate()protected voidonInvalidateKey(K key, swim.streamlet.KeyEffect effect)protected voidonReconcile(int version)protected voidonReconcileKey(K key, swim.streamlet.KeyEffect effect, int version)swim.streamlet.Outlet<V>outlet(K key)Iterator<swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>>>outputIterator()Map.Entry<K,V>previousEntry(K key)KpreviousKey(K key)VpreviousValue(K key)Vput(K key, V value)voidputAll(Map<? extends K,? extends V> map)voidreconcile(int version)voidreconcileInput(int version)voidreconcileInputKey(K key, int version)voidreconcileKey(K key, int version)voidreconcileOutput(int version)voidreconcileOutputKey(K key, int version)Vremove(Object key)voidsetKeyForm(swim.structure.Form<K> keyForm)voidsetValueForm(swim.structure.Form<V> valueForm)intsize()swim.util.OrderedMap<K,V>snapshot()swim.util.OrderedMap<K,V>subMap(K fromKey, K toKey)swim.util.OrderedMap<K,V>tailMap(K fromKey)voidtake(int upper)protected ObjecttypesafeObservers(Object observers)voidunbindInput()voidunbindOutput(swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>> output)voidunbindOutputs()MapLaneView<K,V>unobserve(Object observer)<V2> MapLaneView<K,V2>valueClass(Class<V2> valueClass)swim.structure.Form<V>valueForm()<V2> MapLaneView<K,V2>valueForm(swim.structure.Form<V2> valueForm)swim.util.Cursor<V>valueIterator()Collection<V>values()MapLaneView<K,V>willClear(swim.observable.function.WillClear willClear)MapLaneView<K,V>willCommand(swim.api.lane.function.WillCommand willCommand)MapLaneView<K,V>willDrop(swim.observable.function.WillDrop willDrop)MapLaneView<K,V>willEnter(swim.api.lane.function.WillEnter willEnter)protected voidwillInvalidate()protected voidwillInvalidateKey(K key, swim.streamlet.KeyEffect effect)MapLaneView<K,V>willLeave(swim.api.lane.function.WillLeave willLeave)protected voidwillReconcile(int version)protected voidwillReconcileKey(K key, swim.streamlet.KeyEffect effect, int version)MapLaneView<K,V>willRemove(swim.observable.function.WillRemoveKey<K> willRemove)MapLaneView<K,V>willRequest(swim.api.http.function.WillRequestHttp<?> willRequest)MapLaneView<K,V>willRespond(swim.api.http.function.WillRespondHttp<?> willRespond)MapLaneView<K,V>willTake(swim.observable.function.WillTake willTake)protected voidwillUpdate(int version)MapLaneView<K,V>willUpdate(swim.observable.function.WillUpdateKey<K,V> willUpdate)MapLaneView<K,V>willUplink(swim.api.lane.function.WillUplink willUplink)-
Methods inherited from class swim.runtime.lane.LaneView
debug, dispatchDecodeRequest, dispatchDidCommand, dispatchDidEnter, dispatchDidLeave, dispatchDidRequest, dispatchDidRespond, dispatchDidUplink, dispatchDoRespond, dispatchWillCommand, dispatchWillEnter, dispatchWillLeave, dispatchWillRequest, dispatchWillRespond, dispatchWillUplink, error, hostUri, info, laneDecodeRequest, laneDidCommand, laneDidEnter, laneDidFail, laneDidLeave, laneDidRequest, laneDidRespond, laneDidUplink, laneDoRespond, laneUri, laneWillCommand, laneWillEnter, laneWillLeave, laneWillRequest, laneWillRespond, laneWillUplink, nodeUri, trace, unwrapLane, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface swim.api.lane.Lane
debug, error, hostUri, info, laneUri, nodeUri, trace, warn
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
agentContext
protected final swim.api.agent.AgentContext agentContext
-
keyForm
protected swim.structure.Form<K> keyForm
-
valueForm
protected swim.structure.Form<V> valueForm
-
flags
protected int flags
-
laneBinding
protected MapLaneModel laneBinding
-
effects
protected swim.collections.HashTrieMap<K,swim.streamlet.KeyEffect> effects
-
version
protected int version
-
-
Method Detail
-
agentContext
public swim.api.agent.AgentContext agentContext()
- Specified by:
agentContextin classLaneView
-
getLaneBinding
public MapLaneModel getLaneBinding()
- Specified by:
getLaneBindingin classLaneView
-
createLaneBinding
public MapLaneModel createLaneBinding()
- Specified by:
createLaneBindingin classLaneView
-
keyForm
public final swim.structure.Form<K> keyForm()
-
keyForm
public <K2> MapLaneView<K2,V> keyForm(swim.structure.Form<K2> keyForm)
-
keyClass
public <K2> MapLaneView<K2,V> keyClass(Class<K2> keyClass)
-
setKeyForm
public void setKeyForm(swim.structure.Form<K> keyForm)
-
valueForm
public final swim.structure.Form<V> valueForm()
-
valueForm
public <V2> MapLaneView<K,V2> valueForm(swim.structure.Form<V2> valueForm)
-
valueClass
public <V2> MapLaneView<K,V2> valueClass(Class<V2> valueClass)
-
setValueForm
public void setValueForm(swim.structure.Form<V> valueForm)
-
isResident
public final boolean isResident()
-
isResident
public MapLaneView<K,V> isResident(boolean isResident)
-
isTransient
public final boolean isTransient()
-
isTransient
public MapLaneView<K,V> isTransient(boolean isTransient)
-
isSigned
public final boolean isSigned()
- Specified by:
isSignedin interfaceswim.api.lane.Lane
-
isSigned
public MapLaneView<K,V> isSigned(boolean isSigned)
-
close
public void close()
-
observe
public MapLaneView<K,V> observe(Object observer)
- Specified by:
observein interfaceswim.api.http.HttpLane<K>- Specified by:
observein interfaceswim.api.lane.Lane- Specified by:
observein interfaceswim.api.lane.MapLane<K,V>- Specified by:
observein interfaceswim.observable.Observable<K>- Specified by:
observein interfaceswim.observable.ObservableMap<K,V>- Specified by:
observein interfaceswim.observable.ObservableSortedMap<K,V>- Overrides:
observein classLaneView
-
unobserve
public MapLaneView<K,V> unobserve(Object observer)
- Specified by:
unobservein interfaceswim.api.http.HttpLane<K>- Specified by:
unobservein interfaceswim.api.lane.Lane- Specified by:
unobservein interfaceswim.api.lane.MapLane<K,V>- Specified by:
unobservein interfaceswim.observable.Observable<K>- Specified by:
unobservein interfaceswim.observable.ObservableMap<K,V>- Specified by:
unobservein interfaceswim.observable.ObservableSortedMap<K,V>- Overrides:
unobservein classLaneView
-
willUpdate
public MapLaneView<K,V> willUpdate(swim.observable.function.WillUpdateKey<K,V> willUpdate)
-
didUpdate
public MapLaneView<K,V> didUpdate(swim.observable.function.DidUpdateKey<K,V> didUpdate)
-
willRemove
public MapLaneView<K,V> willRemove(swim.observable.function.WillRemoveKey<K> willRemove)
-
didRemove
public MapLaneView<K,V> didRemove(swim.observable.function.DidRemoveKey<K,V> didRemove)
-
willDrop
public MapLaneView<K,V> willDrop(swim.observable.function.WillDrop willDrop)
-
didDrop
public MapLaneView<K,V> didDrop(swim.observable.function.DidDrop didDrop)
-
willTake
public MapLaneView<K,V> willTake(swim.observable.function.WillTake willTake)
-
didTake
public MapLaneView<K,V> didTake(swim.observable.function.DidTake didTake)
-
willClear
public MapLaneView<K,V> willClear(swim.observable.function.WillClear willClear)
-
didClear
public MapLaneView<K,V> didClear(swim.observable.function.DidClear didClear)
-
willCommand
public MapLaneView<K,V> willCommand(swim.api.lane.function.WillCommand willCommand)
- Specified by:
willCommandin interfaceswim.api.lane.Lane- Specified by:
willCommandin interfaceswim.api.lane.MapLane<K,V>- Specified by:
willCommandin classLaneView
-
didCommand
public MapLaneView<K,V> didCommand(swim.api.lane.function.DidCommand didCommand)
- Specified by:
didCommandin interfaceswim.api.lane.Lane- Specified by:
didCommandin interfaceswim.api.lane.MapLane<K,V>- Specified by:
didCommandin classLaneView
-
willUplink
public MapLaneView<K,V> willUplink(swim.api.lane.function.WillUplink willUplink)
- Specified by:
willUplinkin interfaceswim.api.lane.Lane- Specified by:
willUplinkin interfaceswim.api.lane.MapLane<K,V>- Specified by:
willUplinkin classLaneView
-
didUplink
public MapLaneView<K,V> didUplink(swim.api.lane.function.DidUplink didUplink)
-
willEnter
public MapLaneView<K,V> willEnter(swim.api.lane.function.WillEnter willEnter)
-
didEnter
public MapLaneView<K,V> didEnter(swim.api.lane.function.DidEnter didEnter)
-
willLeave
public MapLaneView<K,V> willLeave(swim.api.lane.function.WillLeave willLeave)
-
didLeave
public MapLaneView<K,V> didLeave(swim.api.lane.function.DidLeave didLeave)
-
decodeRequest
public MapLaneView<K,V> decodeRequest(swim.api.http.function.DecodeRequestHttp<Object> decodeRequest)
- Specified by:
decodeRequestin interfaceswim.api.http.HttpLane<K>- Specified by:
decodeRequestin interfaceswim.api.lane.Lane- Specified by:
decodeRequestin interfaceswim.api.lane.MapLane<K,V>- Specified by:
decodeRequestin classLaneView
-
willRequest
public MapLaneView<K,V> willRequest(swim.api.http.function.WillRequestHttp<?> willRequest)
- Specified by:
willRequestin interfaceswim.api.http.HttpLane<K>- Specified by:
willRequestin interfaceswim.api.lane.Lane- Specified by:
willRequestin interfaceswim.api.lane.MapLane<K,V>- Specified by:
willRequestin classLaneView
-
didRequest
public MapLaneView<K,V> didRequest(swim.api.http.function.DidRequestHttp<Object> didRequest)
- Specified by:
didRequestin interfaceswim.api.http.HttpLane<K>- Specified by:
didRequestin interfaceswim.api.lane.Lane- Specified by:
didRequestin interfaceswim.api.lane.MapLane<K,V>- Specified by:
didRequestin classLaneView
-
doRespond
public MapLaneView<K,V> doRespond(swim.api.http.function.DoRespondHttp<Object> doRespond)
-
willRespond
public MapLaneView<K,V> willRespond(swim.api.http.function.WillRespondHttp<?> willRespond)
- Specified by:
willRespondin interfaceswim.api.http.HttpLane<K>- Specified by:
willRespondin interfaceswim.api.lane.Lane- Specified by:
willRespondin interfaceswim.api.lane.MapLane<K,V>- Specified by:
willRespondin classLaneView
-
didRespond
public MapLaneView<K,V> didRespond(swim.api.http.function.DidRespondHttp<?> didRespond)
- Specified by:
didRespondin interfaceswim.api.http.HttpLane<K>- Specified by:
didRespondin interfaceswim.api.lane.Lane- Specified by:
didRespondin interfaceswim.api.lane.MapLane<K,V>- Specified by:
didRespondin classLaneView
-
dispatchWillUpdate
protected Map.Entry<Boolean,V> dispatchWillUpdate(swim.api.Link link, K key, V newValue, boolean preemptive)
-
dispatchDidUpdate
protected boolean dispatchDidUpdate(swim.api.Link link, K key, V newValue, V oldValue, boolean preemptive)
-
dispatchWillRemove
protected boolean dispatchWillRemove(swim.api.Link link, K key, boolean preemptive)
-
dispatchDidRemove
protected boolean dispatchDidRemove(swim.api.Link link, K key, V oldValue, boolean preemptive)
-
dispatchWillDrop
protected boolean dispatchWillDrop(swim.api.Link link, int lower, boolean preemptive)
-
dispatchDidDrop
protected boolean dispatchDidDrop(swim.api.Link link, int lower, boolean preemptive)
-
dispatchWillTake
protected boolean dispatchWillTake(swim.api.Link link, int upper, boolean preemptive)
-
dispatchDidTake
protected boolean dispatchDidTake(swim.api.Link link, int upper, boolean preemptive)
-
dispatchWillClear
protected boolean dispatchWillClear(swim.api.Link link, boolean preemptive)
-
dispatchDidClear
protected boolean dispatchDidClear(swim.api.Link link, boolean preemptive)
-
laneWillRemove
public void laneWillRemove(K key)
-
laneWillDrop
public void laneWillDrop(int lower)
-
laneDidDrop
public void laneDidDrop(int lower)
-
laneWillTake
public void laneWillTake(int upper)
-
laneDidTake
public void laneDidTake(int upper)
-
laneWillClear
public void laneWillClear()
-
laneDidClear
public void laneDidClear()
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
containsKey
public boolean containsKey(Object key)
-
containsValue
public boolean containsValue(Object value)
-
indexOf
public int indexOf(Object key)
-
firstKey
public K firstKey()
-
lastKey
public K lastKey()
-
drop
public void drop(int lower)
-
take
public void take(int upper)
-
clear
public void clear()
-
values
public Collection<V> values()
-
keyIterator
public swim.util.Cursor<K> keyIterator()
-
valueIterator
public swim.util.Cursor<V> valueIterator()
-
comparator
public Comparator<? super K> comparator()
-
get
public swim.api.lane.MapLane<K,V> get()
- Specified by:
getin interfaceswim.streamlet.Outlet<K>
-
input
public swim.streamlet.MapOutlet<K,V,? extends Map<K,V>> input()
- Specified by:
inputin interfaceswim.streamlet.Inlet<K>
-
bindInput
public void bindInput(swim.streamlet.Outlet<? extends Map<K,V>> input)
- Specified by:
bindInputin interfaceswim.streamlet.Inlet<K>
-
unbindInput
public void unbindInput()
- Specified by:
unbindInputin interfaceswim.streamlet.Inlet<K>
-
disconnectInputs
public void disconnectInputs()
-
outputIterator
public Iterator<swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>>> outputIterator()
- Specified by:
outputIteratorin interfaceswim.streamlet.Outlet<K>
-
bindOutput
public void bindOutput(swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>> output)
- Specified by:
bindOutputin interfaceswim.streamlet.Outlet<K>
-
unbindOutput
public void unbindOutput(swim.streamlet.Inlet<? super swim.api.lane.MapLane<K,V>> output)
- Specified by:
unbindOutputin interfaceswim.streamlet.Outlet<K>
-
unbindOutputs
public void unbindOutputs()
- Specified by:
unbindOutputsin interfaceswim.streamlet.Outlet<K>
-
disconnectOutputs
public void disconnectOutputs()
-
invalidateOutputKey
public void invalidateOutputKey(K key, swim.streamlet.KeyEffect effect)
-
invalidateInputKey
public void invalidateInputKey(K key, swim.streamlet.KeyEffect effect)
-
invalidateKey
public void invalidateKey(K key, swim.streamlet.KeyEffect effect)
-
invalidateOutput
public void invalidateOutput()
- Specified by:
invalidateOutputin interfaceswim.streamlet.Inlet<K>
-
invalidateInput
public void invalidateInput()
- Specified by:
invalidateInputin interfaceswim.streamlet.Outlet<K>
-
invalidate
public void invalidate()
-
reconcileOutputKey
public void reconcileOutputKey(K key, int version)
-
reconcileInputKey
public void reconcileInputKey(K key, int version)
-
reconcileKey
public void reconcileKey(K key, int version)
-
reconcileOutput
public void reconcileOutput(int version)
- Specified by:
reconcileOutputin interfaceswim.streamlet.Inlet<K>
-
reconcileInput
public void reconcileInput(int version)
- Specified by:
reconcileInputin interfaceswim.streamlet.Outlet<K>
-
reconcile
public void reconcile(int version)
-
willInvalidateKey
protected void willInvalidateKey(K key, swim.streamlet.KeyEffect effect)
-
onInvalidateKey
protected void onInvalidateKey(K key, swim.streamlet.KeyEffect effect)
-
didInvalidateKey
protected void didInvalidateKey(K key, swim.streamlet.KeyEffect effect)
-
willInvalidate
protected void willInvalidate()
-
onInvalidate
protected void onInvalidate()
-
didInvalidate
protected void didInvalidate()
-
willUpdate
protected void willUpdate(int version)
-
didUpdate
protected void didUpdate(int version)
-
willReconcileKey
protected void willReconcileKey(K key, swim.streamlet.KeyEffect effect, int version)
-
onReconcileKey
protected void onReconcileKey(K key, swim.streamlet.KeyEffect effect, int version)
-
didReconcileKey
protected void didReconcileKey(K key, swim.streamlet.KeyEffect effect, int version)
-
willReconcile
protected void willReconcile(int version)
-
onReconcile
protected void onReconcile(int version)
-
didReconcile
protected void didReconcile(int version)
-
-