-
- All Superinterfaces:
Outlet<O>
- All Known Subinterfaces:
MapDownlink<K,V>
,MapInletMapOutlet<KI,KO,VI,VO,I,O>
,MapInoutlet<K,VI,VO,I,O>
,MapLane<K,V>
,RecordOutlet
- All Known Implementing Classes:
AbstractMapInletMapOutlet
,AbstractMapInoutlet
,AbstractMapOutlet
,AbstractRecordOutlet
,DownlinkRecord
,FilterFieldsCombinator
,FilterFieldsOperator
,JoinMapLaneDownlink
,ListDownlinkRecord
,MapDownlinkRecord
,MapDownlinkView
,MapFieldValuesCombinator
,MapFieldValuesOperator
,MapInput
,MapLaneView
,MemoizeMapCombinator
,RecordModel
,RecordScope
,ValueDownlinkRecord
public interface MapOutlet<K,V,O> extends Outlet<O>
Output connector from aStreamlet
for a key-value map state.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
containsKey(K key)
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.void
decohereInputKey(K key, KeyEffect effect)
Marks thisMapOutlet
as needing aneffect
applied to a givenkey
.default MapOutlet<K,V,? extends Map<K,V>>
filter(FilterFieldsFunction<? super K,? super V> func)
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
.default <V2> MapOutlet<K,V2,? extends Map<K,V2>>
map(MapFieldValuesFunction<? super K,? super V,V2> func)
default MapOutlet<K,V,O>
memoize()
Outlet<V>
outlet(K key)
Returns anOutlet
that updates when the specifiedkey
updates.void
recohereInputKey(K key, int version)
Updates the state of an individualkey
in thisMapOutlet
to make it consistent with the targetversion
.default <U> Outlet<U>
reduce(U identity, CombinerFunction<? super V,U> accumulator, CombinerFunction<U,U> combiner)
default MapOutlet<K,V,O>
watch(WatchFieldsFunction<? super K,? super V> func)
-
Methods inherited from interface swim.streamlet.Outlet
bindOutput, decohereInput, disconnectInputs, disconnectOutputs, get, map, outputIterator, recohereInput, unbindOutput, unbindOutputs, watch
-
-
-
-
Method Detail
-
containsKey
boolean containsKey(K key)
Returnstrue
if the current state of thisMapOutlet
contains the givenkey
; otherwise returnsfalse
.
-
get
V get(K key)
Returns the value assocaited with the givenkey
in the current state of thisMapOutlet
, if defined; otherwise returnsnull
.
-
keyIterator
Iterator<K> keyIterator()
Returns anIterator
over the keys in the current state of thisMapOutlet
.
-
decohereInputKey
void decohereInputKey(K key, KeyEffect effect)
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
.
-
recohereInputKey
void recohereInputKey(K key, int version)
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
.
-
filter
default MapOutlet<K,V,? extends Map<K,V>> filter(FilterFieldsFunction<? super K,? super V> func)
-
map
default <V2> MapOutlet<K,V2,? extends Map<K,V2>> map(MapFieldValuesFunction<? super K,? super V,V2> func)
-
reduce
default <U> Outlet<U> reduce(U identity, CombinerFunction<? super V,U> accumulator, CombinerFunction<U,U> combiner)
-
-