- java.lang.Object
-
- swim.system.DownlinkView
-
- swim.system.warp.WarpDownlinkView
-
- swim.system.downlink.MapDownlinkView<K,V>
-
- All Implemented Interfaces:
Iterable<Map.Entry<K,V>>
,Map<K,V>
,SortedMap<K,V>
,Downlink
,MapDownlink<K,V>
,Link
,WarpDownlink
,WarpLink
,Observable<Object>
,ObservableIterableMap<K,V>
,ObservableMap<K,V>
,ObservableOrderedMap<K,V>
,ObservableSortedMap<K,V>
,Inlet<Map<K,V>>
,MapInlet<K,V,Map<K,V>>
,MapOutlet<K,V,MapDownlink<K,V>>
,Outlet<MapDownlink<K,V>>
,IterableMap<K,V>
,Log
,OrderedMap<K,V>
- Direct Known Subclasses:
JoinMapLaneDownlink
public class MapDownlinkView<K,V> extends WarpDownlinkView implements MapDownlink<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected HashTrieMap<K,KeyEffect>
effects
protected MapOutlet<K,V,? extends Map<K,V>>
input
protected Form<K>
keyForm
protected MapDownlinkModel
model
protected HashTrieMap<K,KeyOutlet<K,V>>
outlets
protected Inlet<? super MapDownlink<K,V>>[]
outputs
protected static int
STATEFUL
protected Form<V>
valueForm
protected int
version
-
Fields inherited from class swim.system.warp.WarpDownlinkView
body, flags, hostUri, KEEP_LINKED, KEEP_SYNCED, laneUri, meshUri, nodeUri, prio, rate
-
Fields inherited from class swim.system.DownlinkView
cellContext, observers, stage
-
-
Constructor Summary
Constructors Constructor Description MapDownlinkView(CellContext cellContext, Stage stage, Uri meshUri, Uri hostUri, Uri nodeUri, Uri laneUri, float prio, float rate, Value body, int flags, Form<K> keyForm, Form<V> valueForm, Object observers)
MapDownlinkView(CellContext cellContext, Stage stage, Uri meshUri, Uri hostUri, Uri nodeUri, Uri laneUri, float prio, float rate, Value body, Form<K> keyForm, Form<V> valueForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindInput(MapOutlet<K,V,? extends Map<K,V>> input)
void
bindInput(Outlet<? extends Map<K,V>> input)
Connects thisInlet
to anOutlet
from which it will acquire its state.void
bindOutput(Inlet<? super MapDownlink<K,V>> output)
Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
.MapDownlinkView<K,V>
body(Value body)
void
clear()
void
close()
Comparator<? super K>
comparator()
boolean
containsKey(Object keyObject)
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.boolean
containsValue(Object valueObject)
MapDownlinkModel
createDownlinkModel()
void
decohere()
void
decohereInput()
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.void
decohereInputKey(K key, KeyEffect effect)
Marks thisMapOutlet
as needing aneffect
applied to a givenkey
.void
decohereKey(K key, KeyEffect effect)
void
decohereOutput()
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state.void
decohereOutputKey(K key, KeyEffect effect)
Marks thisMapInlet
as needing aneffect
applied to a givenkey
.MapDownlinkView<K,V>
didClear(DidClear didClear)
MapDownlinkView<K,V>
didClose(DidClose didClose)
MapDownlinkView<K,V>
didConnect(DidConnect didConnect)
protected void
didDecohere()
protected void
didDecohereKey(K key, KeyEffect effect)
MapDownlinkView<K,V>
didDisconnect(DidDisconnect didDisconnect)
MapDownlink<K,V>
didDrop(DidDrop didDrop)
MapDownlinkView<K,V>
didFail(DidFail didFail)
MapDownlinkView<K,V>
didLink(DidLink didLink)
MapDownlinkView<K,V>
didReceive(DidReceive didReceive)
protected void
didRecohere(int version)
protected void
didRecohereKey(K key, KeyEffect effect, int version)
MapDownlinkView<K,V>
didRemove(DidRemoveKey<K,V> didRemove)
MapDownlinkView<K,V>
didSync(DidSync didSync)
MapDownlink<K,V>
didTake(DidTake didTake)
MapDownlinkView<K,V>
didUnlink(DidUnlink didUnlink)
MapDownlinkView<K,V>
didUpdate(DidUpdateKey<K,V> didUpdate)
void
disconnectInputs()
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph.boolean
dispatchDidClear(boolean preemptive)
boolean
dispatchDidDrop(int lower, boolean preemptive)
boolean
dispatchDidRemove(K key, V oldValue, boolean preemptive)
boolean
dispatchDidTake(int upper, boolean preemptive)
boolean
dispatchDidUpdate(K key, V newValue, V oldValue, boolean preemptive)
boolean
dispatchWillClear(boolean preemptive)
boolean
dispatchWillDrop(int lower, boolean preemptive)
boolean
dispatchWillRemove(K key, boolean preemptive)
boolean
dispatchWillTake(int upper, boolean preemptive)
Map.Entry<Boolean,V>
dispatchWillUpdate(K key, V newValue, boolean preemptive)
void
downlinkDidClear()
void
downlinkDidDrop(int lower)
void
downlinkDidRemove(K key, V oldValue)
void
downlinkDidRemoveValue(Value key, Value oldValue)
void
downlinkDidTake(int upper)
void
downlinkDidUpdate(K key, V newValue, V oldValue)
void
downlinkDidUpdateValue(Value key, Value newValue, Value oldValue)
MapDownlinkModel
downlinkModel()
void
downlinkWillClear()
void
downlinkWillDrop(int lower)
void
downlinkWillRemove(K key)
void
downlinkWillRemoveValue(Value key)
void
downlinkWillTake(int upper)
V
downlinkWillUpdate(K key, V newValue)
Value
downlinkWillUpdateValue(Value key, Value newValue)
void
drop(int lower)
Set<Map.Entry<K,V>>
entrySet()
Map.Entry<K,V>
firstEntry()
K
firstKey()
V
firstValue()
MapDownlink<K,V>
get()
Returns the current state of thisOutlet
.V
get(Object keyObject)
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
.Map.Entry<K,V>
getEntry(Object keyObject)
Map.Entry<K,V>
getIndex(int index)
OrderedMap<K,V>
headMap(K toKeyObject)
MapDownlinkView<K,V>
hostUri(String hostUri)
MapDownlinkView<K,V>
hostUri(Uri hostUri)
int
indexOf(Object keyObject)
MapOutlet<K,V,? extends Map<K,V>>
input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.boolean
isEmpty()
boolean
isStateful()
MapDownlinkView<K,V>
isStateful(boolean isStateful)
OrderedMapCursor<K,V>
iterator()
MapDownlinkView<K,V>
keepLinked(boolean keepLinked)
MapDownlinkView<K,V>
keepSynced(boolean keepSynced)
<K2> MapDownlinkView<K2,V>
keyClass(Class<K2> keyClass)
Form<K>
keyForm()
<K2> MapDownlinkView<K2,V>
keyForm(Form<K2> keyForm)
Cursor<K>
keyIterator()
Returns anIterator
over the keys in the current state of thisMapOutlet
.Set<K>
keySet()
MapDownlinkView<K,V>
laneUri(String laneUri)
MapDownlinkView<K,V>
laneUri(Uri laneUri)
Map.Entry<K,V>
lastEntry()
K
lastKey()
V
lastValue()
Map.Entry<K,V>
nextEntry(Object keyObject)
K
nextKey(Object keyObject)
V
nextValue(Object keyObject)
MapDownlinkView<K,V>
nodeUri(String nodeUri)
MapDownlinkView<K,V>
nodeUri(Uri nodeUri)
MapDownlinkView<K,V>
observe(Object observer)
protected void
onDecohere()
protected void
onDecohereKey(K key, KeyEffect effect)
protected void
onRecohere(int version)
protected void
onRecohereKey(K key, KeyEffect effect, int version)
MapDownlinkView<K,V>
open()
Outlet<V>
outlet(K key)
Returns anOutlet
that updates when the specifiedkey
updates.Iterator<Inlet<? super MapDownlink<K,V>>>
outputIterator()
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.Map.Entry<K,V>
previousEntry(Object keyObject)
K
previousKey(Object keyObject)
V
previousValue(Object keyObject)
MapDownlinkView<K,V>
prio(float prio)
V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> map)
MapDownlinkView<K,V>
rate(float rate)
void
recohere(int version)
void
recohereInput(int version)
Updates the state of thisOutlet
to make it consistent with the targetversion
.void
recohereInputKey(K key, int version)
Updates the state of an individualkey
in thisMapOutlet
to make it consistent with the targetversion
.void
recohereKey(K key, int version)
void
recohereOutput(int version)
Updates the state of thisInlet
to make it consistent with thetarget
version.void
recohereOutputKey(K key, int version)
Updates the state of an individualkey
in thisMapInlet
to make it consistent with the targetversion
.V
remove(Object key)
int
size()
OrderedMap<K,V>
subMap(K fromKeyObject, K toKeyObject)
OrderedMap<K,V>
tailMap(K fromKeyObject)
void
take(int upper)
protected Object
typesafeObservers(Object observers)
void
unbindInput()
Disconnects thisInlet
from its inputOutlet
, if connected.void
unbindOutput(Inlet<? super MapDownlink<K,V>> output)
Removes anoutput
from the set ofInlet
s that depend on the state of thisOutlet
.void
unbindOutputs()
Disconnects all outputs from thisOutlet
by invokingInlet.unbindInput()
on eachInelt
that depends on the state of thisOutlet
.MapDownlinkView<K,V>
unobserve(Object observer)
<V2> MapDownlinkView<K,V2>
valueClass(Class<V2> valueClass)
Form<V>
valueForm()
<V2> MapDownlinkView<K,V2>
valueForm(Form<V2> valueForm)
Cursor<V>
valueIterator()
Collection<V>
values()
MapDownlinkView<K,V>
willClear(WillClear willClear)
MapDownlinkView<K,V>
willCommand(WillCommand willCommand)
protected void
willDecohere()
protected void
willDecohereKey(K key, KeyEffect effect)
MapDownlink<K,V>
willDrop(WillDrop willDrop)
MapDownlinkView<K,V>
willLink(WillLink willLink)
MapDownlinkView<K,V>
willReceive(WillReceive willReceive)
protected void
willRecohere(int version)
protected void
willRecohereKey(K key, KeyEffect effect, int version)
MapDownlinkView<K,V>
willRemove(WillRemoveKey<K> willRemove)
MapDownlinkView<K,V>
willSync(WillSync willSync)
MapDownlink<K,V>
willTake(WillTake willTake)
MapDownlinkView<K,V>
willUnlink(WillUnlink willUnlink)
MapDownlinkView<K,V>
willUpdate(WillUpdateKey<K,V> willUpdate)
-
Methods inherited from class swim.system.warp.WarpDownlinkView
body, command, command, command, command, dispatchDidLink, dispatchDidReceive, dispatchDidSync, dispatchDidUnlink, dispatchWillCommand, dispatchWillLink, dispatchWillReceive, dispatchWillSync, dispatchWillUnlink, downlinkDidLink, downlinkDidReceive, downlinkDidSync, downlinkDidUnlink, downlinkWillCommand, downlinkWillLink, downlinkWillReceive, downlinkWillSync, downlinkWillUnlink, hostUri, keepLinked, keepSynced, laneUri, meshUri, nodeUri, prio, rate
-
Methods inherited from class swim.system.DownlinkView
cellContext, cipherSuite, debug, dispatchDidClose, dispatchDidConnect, dispatchDidDisconnect, dispatchDidFail, downlinkDidClose, downlinkDidConnect, downlinkDidDisconnect, downlinkDidFail, error, fail, info, isConnected, isRemote, isSecure, localAddress, localCertificates, localIdentity, localPrincipal, remoteAddress, remoteCertificates, remoteIdentity, remotePrincipal, securityProtocol, stage, trace, 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.Link
cipherSuite, hostUri, isConnected, isRemote, isSecure, laneUri, localAddress, localCertificates, localIdentity, localPrincipal, nodeUri, remoteAddress, remoteCertificates, remoteIdentity, remotePrincipal, securityProtocol
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from interface swim.api.warp.WarpDownlink
body, command, command, command, command, keepLinked, keepSynced, prio, rate
-
-
-
-
Field Detail
-
model
protected MapDownlinkModel model
-
effects
protected HashTrieMap<K,KeyEffect> effects
-
outlets
protected HashTrieMap<K,KeyOutlet<K,V>> outlets
-
outputs
protected Inlet<? super MapDownlink<K,V>>[] outputs
-
version
protected int version
-
STATEFUL
protected static final int STATEFUL
- See Also:
- Constant Field Values
-
-
Method Detail
-
downlinkModel
public MapDownlinkModel downlinkModel()
- Specified by:
downlinkModel
in classWarpDownlinkView
-
hostUri
public MapDownlinkView<K,V> hostUri(Uri hostUri)
- Specified by:
hostUri
in interfaceMapDownlink<K,V>
- Specified by:
hostUri
in interfaceWarpDownlink
- Specified by:
hostUri
in classWarpDownlinkView
-
hostUri
public MapDownlinkView<K,V> hostUri(String hostUri)
- Specified by:
hostUri
in interfaceMapDownlink<K,V>
- Specified by:
hostUri
in interfaceWarpDownlink
- Specified by:
hostUri
in classWarpDownlinkView
-
nodeUri
public MapDownlinkView<K,V> nodeUri(Uri nodeUri)
- Specified by:
nodeUri
in interfaceMapDownlink<K,V>
- Specified by:
nodeUri
in interfaceWarpDownlink
- Specified by:
nodeUri
in classWarpDownlinkView
-
nodeUri
public MapDownlinkView<K,V> nodeUri(String nodeUri)
- Specified by:
nodeUri
in interfaceMapDownlink<K,V>
- Specified by:
nodeUri
in interfaceWarpDownlink
- Specified by:
nodeUri
in classWarpDownlinkView
-
laneUri
public MapDownlinkView<K,V> laneUri(Uri laneUri)
- Specified by:
laneUri
in interfaceMapDownlink<K,V>
- Specified by:
laneUri
in interfaceWarpDownlink
- Specified by:
laneUri
in classWarpDownlinkView
-
laneUri
public MapDownlinkView<K,V> laneUri(String laneUri)
- Specified by:
laneUri
in interfaceMapDownlink<K,V>
- Specified by:
laneUri
in interfaceWarpDownlink
- Specified by:
laneUri
in classWarpDownlinkView
-
prio
public MapDownlinkView<K,V> prio(float prio)
- Specified by:
prio
in interfaceMapDownlink<K,V>
- Specified by:
prio
in interfaceWarpDownlink
- Specified by:
prio
in classWarpDownlinkView
-
rate
public MapDownlinkView<K,V> rate(float rate)
- Specified by:
rate
in interfaceMapDownlink<K,V>
- Specified by:
rate
in interfaceWarpDownlink
- Specified by:
rate
in classWarpDownlinkView
-
body
public MapDownlinkView<K,V> body(Value body)
- Specified by:
body
in interfaceMapDownlink<K,V>
- Specified by:
body
in interfaceWarpDownlink
- Specified by:
body
in classWarpDownlinkView
-
keepLinked
public MapDownlinkView<K,V> keepLinked(boolean keepLinked)
- Specified by:
keepLinked
in interfaceMapDownlink<K,V>
- Specified by:
keepLinked
in interfaceWarpDownlink
- Specified by:
keepLinked
in classWarpDownlinkView
-
keepSynced
public MapDownlinkView<K,V> keepSynced(boolean keepSynced)
- Specified by:
keepSynced
in interfaceMapDownlink<K,V>
- Specified by:
keepSynced
in interfaceWarpDownlink
- Specified by:
keepSynced
in classWarpDownlinkView
-
isStateful
public final boolean isStateful()
- Specified by:
isStateful
in interfaceMapDownlink<K,V>
-
isStateful
public MapDownlinkView<K,V> isStateful(boolean isStateful)
- Specified by:
isStateful
in interfaceMapDownlink<K,V>
-
keyForm
public <K2> MapDownlinkView<K2,V> keyForm(Form<K2> keyForm)
- Specified by:
keyForm
in interfaceMapDownlink<K,V>
-
keyClass
public <K2> MapDownlinkView<K2,V> keyClass(Class<K2> keyClass)
- Specified by:
keyClass
in interfaceMapDownlink<K,V>
-
valueForm
public <V2> MapDownlinkView<K,V2> valueForm(Form<V2> valueForm)
- Specified by:
valueForm
in interfaceMapDownlink<K,V>
-
valueClass
public <V2> MapDownlinkView<K,V2> valueClass(Class<V2> valueClass)
- Specified by:
valueClass
in interfaceMapDownlink<K,V>
-
observe
public MapDownlinkView<K,V> observe(Object observer)
- Specified by:
observe
in interfaceDownlink
- Specified by:
observe
in interfaceLink
- Specified by:
observe
in interfaceMapDownlink<K,V>
- Specified by:
observe
in interfaceObservable<K>
- Specified by:
observe
in interfaceObservableMap<K,V>
- Specified by:
observe
in interfaceObservableSortedMap<K,V>
- Specified by:
observe
in interfaceWarpDownlink
- Overrides:
observe
in classWarpDownlinkView
-
unobserve
public MapDownlinkView<K,V> unobserve(Object observer)
- Specified by:
unobserve
in interfaceDownlink
- Specified by:
unobserve
in interfaceLink
- Specified by:
unobserve
in interfaceMapDownlink<K,V>
- Specified by:
unobserve
in interfaceObservable<K>
- Specified by:
unobserve
in interfaceObservableMap<K,V>
- Specified by:
unobserve
in interfaceObservableSortedMap<K,V>
- Specified by:
unobserve
in interfaceWarpDownlink
- Overrides:
unobserve
in classWarpDownlinkView
-
willUpdate
public MapDownlinkView<K,V> willUpdate(WillUpdateKey<K,V> willUpdate)
- Specified by:
willUpdate
in interfaceMapDownlink<K,V>
- Specified by:
willUpdate
in interfaceObservableMap<K,V>
-
didUpdate
public MapDownlinkView<K,V> didUpdate(DidUpdateKey<K,V> didUpdate)
- Specified by:
didUpdate
in interfaceMapDownlink<K,V>
- Specified by:
didUpdate
in interfaceObservableMap<K,V>
-
willRemove
public MapDownlinkView<K,V> willRemove(WillRemoveKey<K> willRemove)
- Specified by:
willRemove
in interfaceMapDownlink<K,V>
- Specified by:
willRemove
in interfaceObservableMap<K,V>
-
didRemove
public MapDownlinkView<K,V> didRemove(DidRemoveKey<K,V> didRemove)
- Specified by:
didRemove
in interfaceMapDownlink<K,V>
- Specified by:
didRemove
in interfaceObservableMap<K,V>
-
willDrop
public MapDownlink<K,V> willDrop(WillDrop willDrop)
- Specified by:
willDrop
in interfaceMapDownlink<K,V>
- Specified by:
willDrop
in interfaceObservableSortedMap<K,V>
-
didDrop
public MapDownlink<K,V> didDrop(DidDrop didDrop)
- Specified by:
didDrop
in interfaceMapDownlink<K,V>
- Specified by:
didDrop
in interfaceObservableSortedMap<K,V>
-
willTake
public MapDownlink<K,V> willTake(WillTake willTake)
- Specified by:
willTake
in interfaceMapDownlink<K,V>
- Specified by:
willTake
in interfaceObservableSortedMap<K,V>
-
didTake
public MapDownlink<K,V> didTake(DidTake didTake)
- Specified by:
didTake
in interfaceMapDownlink<K,V>
- Specified by:
didTake
in interfaceObservableSortedMap<K,V>
-
willClear
public MapDownlinkView<K,V> willClear(WillClear willClear)
- Specified by:
willClear
in interfaceMapDownlink<K,V>
- Specified by:
willClear
in interfaceObservableMap<K,V>
-
didClear
public MapDownlinkView<K,V> didClear(DidClear didClear)
- Specified by:
didClear
in interfaceMapDownlink<K,V>
- Specified by:
didClear
in interfaceObservableMap<K,V>
-
willReceive
public MapDownlinkView<K,V> willReceive(WillReceive willReceive)
- Specified by:
willReceive
in interfaceMapDownlink<K,V>
- Specified by:
willReceive
in interfaceWarpDownlink
- Specified by:
willReceive
in classWarpDownlinkView
-
didReceive
public MapDownlinkView<K,V> didReceive(DidReceive didReceive)
- Specified by:
didReceive
in interfaceMapDownlink<K,V>
- Specified by:
didReceive
in interfaceWarpDownlink
- Specified by:
didReceive
in classWarpDownlinkView
-
willCommand
public MapDownlinkView<K,V> willCommand(WillCommand willCommand)
- Specified by:
willCommand
in interfaceMapDownlink<K,V>
- Specified by:
willCommand
in interfaceWarpDownlink
- Specified by:
willCommand
in classWarpDownlinkView
-
willLink
public MapDownlinkView<K,V> willLink(WillLink willLink)
- Specified by:
willLink
in interfaceMapDownlink<K,V>
- Specified by:
willLink
in interfaceWarpDownlink
- Specified by:
willLink
in classWarpDownlinkView
-
didLink
public MapDownlinkView<K,V> didLink(DidLink didLink)
- Specified by:
didLink
in interfaceMapDownlink<K,V>
- Specified by:
didLink
in interfaceWarpDownlink
- Specified by:
didLink
in classWarpDownlinkView
-
willSync
public MapDownlinkView<K,V> willSync(WillSync willSync)
- Specified by:
willSync
in interfaceMapDownlink<K,V>
- Specified by:
willSync
in interfaceWarpDownlink
- Specified by:
willSync
in classWarpDownlinkView
-
didSync
public MapDownlinkView<K,V> didSync(DidSync didSync)
- Specified by:
didSync
in interfaceMapDownlink<K,V>
- Specified by:
didSync
in interfaceWarpDownlink
- Specified by:
didSync
in classWarpDownlinkView
-
willUnlink
public MapDownlinkView<K,V> willUnlink(WillUnlink willUnlink)
- Specified by:
willUnlink
in interfaceMapDownlink<K,V>
- Specified by:
willUnlink
in interfaceWarpDownlink
- Specified by:
willUnlink
in classWarpDownlinkView
-
didUnlink
public MapDownlinkView<K,V> didUnlink(DidUnlink didUnlink)
- Specified by:
didUnlink
in interfaceMapDownlink<K,V>
- Specified by:
didUnlink
in interfaceWarpDownlink
- Specified by:
didUnlink
in classWarpDownlinkView
-
didConnect
public MapDownlinkView<K,V> didConnect(DidConnect didConnect)
- Specified by:
didConnect
in interfaceDownlink
- Specified by:
didConnect
in interfaceMapDownlink<K,V>
- Specified by:
didConnect
in interfaceWarpDownlink
- Specified by:
didConnect
in classWarpDownlinkView
-
didDisconnect
public MapDownlinkView<K,V> didDisconnect(DidDisconnect didDisconnect)
- Specified by:
didDisconnect
in interfaceDownlink
- Specified by:
didDisconnect
in interfaceMapDownlink<K,V>
- Specified by:
didDisconnect
in interfaceWarpDownlink
- Specified by:
didDisconnect
in classWarpDownlinkView
-
didClose
public MapDownlinkView<K,V> didClose(DidClose didClose)
- Specified by:
didClose
in interfaceDownlink
- Specified by:
didClose
in interfaceMapDownlink<K,V>
- Specified by:
didClose
in interfaceWarpDownlink
- Specified by:
didClose
in classWarpDownlinkView
-
didFail
public MapDownlinkView<K,V> didFail(DidFail didFail)
- Specified by:
didFail
in interfaceDownlink
- Specified by:
didFail
in interfaceMapDownlink<K,V>
- Specified by:
didFail
in interfaceWarpDownlink
- Specified by:
didFail
in classWarpDownlinkView
-
downlinkDidUpdateValue
public void downlinkDidUpdateValue(Value key, Value newValue, Value oldValue)
-
downlinkWillRemoveValue
public void downlinkWillRemoveValue(Value key)
-
downlinkWillRemove
public void downlinkWillRemove(K key)
-
downlinkWillDrop
public void downlinkWillDrop(int lower)
-
downlinkDidDrop
public void downlinkDidDrop(int lower)
-
downlinkWillTake
public void downlinkWillTake(int upper)
-
downlinkDidTake
public void downlinkDidTake(int upper)
-
downlinkWillClear
public void downlinkWillClear()
-
downlinkDidClear
public void downlinkDidClear()
-
dispatchWillUpdate
public Map.Entry<Boolean,V> dispatchWillUpdate(K key, V newValue, boolean preemptive)
-
dispatchDidUpdate
public boolean dispatchDidUpdate(K key, V newValue, V oldValue, boolean preemptive)
-
dispatchWillRemove
public boolean dispatchWillRemove(K key, boolean preemptive)
-
dispatchWillDrop
public boolean dispatchWillDrop(int lower, boolean preemptive)
-
dispatchDidDrop
public boolean dispatchDidDrop(int lower, boolean preemptive)
-
dispatchWillTake
public boolean dispatchWillTake(int upper, boolean preemptive)
-
dispatchDidTake
public boolean dispatchDidTake(int upper, boolean preemptive)
-
dispatchWillClear
public boolean dispatchWillClear(boolean preemptive)
-
dispatchDidClear
public boolean dispatchDidClear(boolean preemptive)
-
createDownlinkModel
public MapDownlinkModel createDownlinkModel()
- Specified by:
createDownlinkModel
in classWarpDownlinkView
-
open
public MapDownlinkView<K,V> open()
- Specified by:
open
in interfaceDownlink
- Specified by:
open
in interfaceMapDownlink<K,V>
- Specified by:
open
in interfaceWarpDownlink
- Specified by:
open
in classWarpDownlinkView
-
close
public void close()
- Specified by:
close
in interfaceLink
- Overrides:
close
in classDownlinkView
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
containsKey
public boolean containsKey(Object keyObject)
Description copied from interface:MapOutlet
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.- Specified by:
containsKey
in interfaceIterableMap<K,V>
- Specified by:
containsKey
in interfaceMap<K,V>
- Specified by:
containsKey
in interfaceMapOutlet<K,V,MapDownlink<K,V>>
- Specified by:
containsKey
in interfaceOrderedMap<K,V>
-
containsValue
public boolean containsValue(Object valueObject)
- Specified by:
containsValue
in interfaceIterableMap<K,V>
- Specified by:
containsValue
in interfaceMap<K,V>
- Specified by:
containsValue
in interfaceOrderedMap<K,V>
-
indexOf
public int indexOf(Object keyObject)
- Specified by:
indexOf
in interfaceOrderedMap<K,V>
-
get
public V get(Object keyObject)
Description copied from interface:MapOutlet
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
.
-
getEntry
public Map.Entry<K,V> getEntry(Object keyObject)
- Specified by:
getEntry
in interfaceOrderedMap<K,V>
-
getIndex
public Map.Entry<K,V> getIndex(int index)
- Specified by:
getIndex
in interfaceOrderedMap<K,V>
-
firstEntry
public Map.Entry<K,V> firstEntry()
- Specified by:
firstEntry
in interfaceOrderedMap<K,V>
-
firstKey
public K firstKey()
-
firstValue
public V firstValue()
- Specified by:
firstValue
in interfaceOrderedMap<K,V>
-
lastKey
public K lastKey()
-
lastValue
public V lastValue()
- Specified by:
lastValue
in interfaceOrderedMap<K,V>
-
nextEntry
public Map.Entry<K,V> nextEntry(Object keyObject)
- Specified by:
nextEntry
in interfaceOrderedMap<K,V>
-
nextValue
public V nextValue(Object keyObject)
- Specified by:
nextValue
in interfaceOrderedMap<K,V>
-
previousEntry
public Map.Entry<K,V> previousEntry(Object keyObject)
- Specified by:
previousEntry
in interfaceOrderedMap<K,V>
-
previousKey
public K previousKey(Object keyObject)
- Specified by:
previousKey
in interfaceOrderedMap<K,V>
-
previousValue
public V previousValue(Object keyObject)
- Specified by:
previousValue
in interfaceOrderedMap<K,V>
-
drop
public void drop(int lower)
- Specified by:
drop
in interfaceObservableSortedMap<K,V>
-
take
public void take(int upper)
- Specified by:
take
in interfaceObservableSortedMap<K,V>
-
clear
public void clear()
-
headMap
public OrderedMap<K,V> headMap(K toKeyObject)
-
tailMap
public OrderedMap<K,V> tailMap(K fromKeyObject)
-
subMap
public OrderedMap<K,V> subMap(K fromKeyObject, K toKeyObject)
-
values
public Collection<V> values()
-
iterator
public OrderedMapCursor<K,V> iterator()
-
keyIterator
public Cursor<K> keyIterator()
Description copied from interface:MapOutlet
Returns anIterator
over the keys in the current state of thisMapOutlet
.- Specified by:
keyIterator
in interfaceIterableMap<K,V>
- Specified by:
keyIterator
in interfaceMapDownlink<K,V>
- Specified by:
keyIterator
in interfaceMapOutlet<K,V,MapDownlink<K,V>>
- Specified by:
keyIterator
in interfaceOrderedMap<K,V>
-
valueIterator
public Cursor<V> valueIterator()
- Specified by:
valueIterator
in interfaceIterableMap<K,V>
- Specified by:
valueIterator
in interfaceOrderedMap<K,V>
-
comparator
public Comparator<? super K> comparator()
- Specified by:
comparator
in interfaceOrderedMap<K,V>
- Specified by:
comparator
in interfaceSortedMap<K,V>
-
get
public MapDownlink<K,V> get()
Description copied from interface:Outlet
Returns the current state of thisOutlet
.
-
input
public MapOutlet<K,V,? extends Map<K,V>> input()
Description copied from interface:Inlet
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.
-
bindInput
public void bindInput(Outlet<? extends Map<K,V>> input)
Description copied from interface:Inlet
Connects thisInlet
to anOutlet
from which it will acquire its state. If thisInlet
is already connected, it will first disconnect from its existing input. Then, after updating itsinput
property, theInlet
will invokeOutlet.bindOutput(Inlet)
on its newinput
.
-
unbindInput
public void unbindInput()
Description copied from interface:Inlet
Disconnects thisInlet
from its inputOutlet
, if connected. After setting itsinput
property tonull
, theInlet
will invokeOutlet.unbindOutput(Inlet)
on its old input, if defined.- Specified by:
unbindInput
in interfaceInlet<K>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:Inlet
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet
.- Specified by:
disconnectInputs
in interfaceInlet<K>
- Specified by:
disconnectInputs
in interfaceOutlet<K>
-
outlet
public Outlet<V> outlet(K key)
Description copied from interface:MapOutlet
Returns anOutlet
that updates when the specifiedkey
updates.
-
outputIterator
public Iterator<Inlet<? super MapDownlink<K,V>>> outputIterator()
Description copied from interface:Outlet
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.- Specified by:
outputIterator
in interfaceOutlet<K>
-
bindOutput
public void bindOutput(Inlet<? super MapDownlink<K,V>> output)
Description copied from interface:Outlet
Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
. Theoutput
will be decohered when the state of thisOutlet
is decohered, and recohered when thisOutlet
is recohered.- Specified by:
bindOutput
in interfaceOutlet<K>
-
unbindOutput
public void unbindOutput(Inlet<? super MapDownlink<K,V>> output)
Description copied from interface:Outlet
Removes anoutput
from the set ofInlet
s that depend on the state of thisOutlet
.- Specified by:
unbindOutput
in interfaceOutlet<K>
-
unbindOutputs
public void unbindOutputs()
Description copied from interface:Outlet
Disconnects all outputs from thisOutlet
by invokingInlet.unbindInput()
on eachInelt
that depends on the state of thisOutlet
.- Specified by:
unbindOutputs
in interfaceOutlet<K>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:Inlet
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet
.- Specified by:
disconnectOutputs
in interfaceInlet<K>
- Specified by:
disconnectOutputs
in interfaceOutlet<K>
-
decohereOutputKey
public void decohereOutputKey(K key, KeyEffect effect)
Description copied from interface:MapInlet
Marks thisMapInlet
as needing aneffect
applied 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
.
-
decohereInputKey
public void decohereInputKey(K key, KeyEffect effect)
Description copied from interface:MapOutlet
Marks thisMapOutlet
as needing aneffect
applied 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:
decohereInputKey
in interfaceMapOutlet<K,V,MapDownlink<K,V>>
-
decohereOutput
public void decohereOutput()
Description copied from interface:Inlet
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state. Decohering anInlet
will recursively decohere all streamlets that transitively depend on the state of thisInlet
. Decohering anInlet
does not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)
call will eventually make the state of theInlet
coherent again.- Specified by:
decohereOutput
in interfaceInlet<K>
-
decohereInput
public void decohereInput()
Description copied from interface:Outlet
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.- Specified by:
decohereInput
in interfaceOutlet<K>
-
decohere
public void decohere()
-
recohereOutputKey
public void recohereOutputKey(K key, int version)
Description copied from interface:MapInlet
Updates the state of an individualkey
in thisMapInlet
to make it consistent with the targetversion
. TheMapInlet
only needs to update if the currentversion
differs from the targetversion
. To update the state of a key, theMapInlet
first 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, theMapInlet
invokesStreamlet.recohere(int)
on its attached streamlet.
-
recohereInputKey
public void recohereInputKey(K key, int version)
Description copied from interface:MapOutlet
Updates the state of an individualkey
in thisMapOutlet
to make it consistent with the targetversion
. TheMapOutlet
only needs to update if its currentversion
differs from the targetversion
. To update the state of a key, theMapOutlet
first 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:
recohereInputKey
in interfaceMapOutlet<K,V,MapDownlink<K,V>>
-
recohereKey
public void recohereKey(K key, int version)
-
recohereOutput
public void recohereOutput(int version)
Description copied from interface:Inlet
Updates the state of thisInlet
to make it consistent with thetarget
version. TheInlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theInlet
first invokesOutlet.recohereInput(int)
on itsinput
, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)
on theStreamlet
to which it's attached, causing theStreamlet
to make its own state coherent again.- Specified by:
recohereOutput
in interfaceInlet<K>
-
recohereInput
public void recohereInput(int version)
Description copied from interface:Outlet
Updates the state of thisOutlet
to make it consistent with the targetversion
. TheOutlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theOutlet
first invokesStreamlet.recohere(int)
on theStreamlet
to which it's attached. It then invokesInlet.recohereOutput(int)
on each of its dependentoutputs
.- Specified by:
recohereInput
in interfaceOutlet<K>
-
recohere
public void recohere(int version)
-
willDecohere
protected void willDecohere()
-
onDecohere
protected void onDecohere()
-
didDecohere
protected void didDecohere()
-
willRecohere
protected void willRecohere(int version)
-
onRecohere
protected void onRecohere(int version)
-
didRecohere
protected void didRecohere(int version)
-
-