- java.lang.Object
-
- swim.structure.Item
-
- swim.structure.Value
-
- swim.structure.Record
-
- swim.dataflow.AbstractRecordOutlet
-
- All Implemented Interfaces:
Comparable<Item>
,Iterable<Item>
,Collection<Item>
,List<Item>
,Debug
,Display
,RecordOutlet
,MapOutlet<Value,Value,Record>
,Outlet<Record>
,StreamletScope<Value>
,Builder<Item,Record>
,PairBuilder<Value,Value,Record>
- Direct Known Subclasses:
DownlinkRecord
,RecordModel
public abstract class AbstractRecordOutlet extends Record implements RecordOutlet
-
-
Constructor Summary
Constructors Constructor Description AbstractRecordOutlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
bindOutput(Inlet<? super Record> output)
Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
.boolean
containsOwnKey(Value key)
void
decohereInput()
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.void
decohereInputKey(Value key, KeyEffect effect)
Marks thisMapOutlet
as needing aneffect
applied to a givenkey
.protected void
didDecohereInput()
protected void
didDecohereInputKey(Value key, KeyEffect effect)
protected void
didRecohereInput(int version)
protected void
didRecohereInputKey(Value key, KeyEffect effect, int version)
void
disconnectInputs()
Disconnects allInlet
s dominated by thisOutlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allOutlet
s dominated by thisOutlet
in the dataflow graph.Record
get()
Returns the current state of thisOutlet
.abstract Iterator<Value>
keyIterator()
Returns anIterator
over the keys in the current state of thisMapOutlet
.protected void
onDecohereInput()
protected void
onDecohereInputKey(Value key, KeyEffect effect)
protected void
onRecohereInput(int version)
protected void
onRecohereInputKey(Value key, KeyEffect effect, int version)
Outlet<Value>
outlet(String key)
Returns anOutlet
that updates when the specifiedkey
updates.Outlet<Value>
outlet(Value key)
Returns anOutlet
that updates when the specifiedkey
updates.Iterator<Inlet<? super Record>>
outputIterator()
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.void
recohereInput(int version)
Updates the state of thisOutlet
to make it consistent with the targetversion
.void
recohereInputKey(Value key, int version)
Updates the state of an individualkey
in thisMapOutlet
to make it consistent with the targetversion
.StreamletContext
streamletContext()
Returns the environment in which thisStreamletScope
operates.StreamletScope<? extends Value>
streamletScope()
Returns the lexically scoped parent of thisStreamletScope
.void
unbindOutput(Inlet<? super Record> 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
.protected void
willDecohereInput()
protected void
willDecohereInputKey(Value key, KeyEffect effect)
protected void
willRecohereInput(int version)
protected void
willRecohereInputKey(Value key, KeyEffect effect, int version)
-
Methods inherited from class swim.structure.Record
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addAll, addAll, alias, appended, appended, asMutable, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, attr, bind, body, branch, clear, commit, compareTo, compareTo, concat, contains, contains, containsAll, containsKey, containsKey, containsValue, create, create, debug, empty, entrySet, equals, evaluate, fieldCount, fieldIterator, fieldSet, flattened, get, get, get, getAttr, getAttr, getField, getField, getItem, getSlot, getSlot, hashCode, head, header, headers, indexOf, isAliased, isArray, isConstant, isDefinite, isEmpty, isMutable, isObject, item, item, item, item, item, item, item, iterator, keySet, lastIndexOf, length, listIterator, listIterator, of, of, of, prepended, prepended, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putAttr, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, putSlot, remove, remove, removeAll, removed, removed, removeKey, removeKey, retainAll, set, setItem, setItem, setItem, setItem, setItem, setItem, setItem, size, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, slot, stringValue, stringValue, subList, substitute, tag, tail, target, toArray, toArray, typeOrder, unflattened, updated, updated, updatedAttr, updatedAttr, updatedSlot, updatedSlot, valueCount, valueIterator, values
-
Methods inherited from class swim.structure.Value
absent, and, and, bitwiseAnd, bitwiseAnd, bitwiseNot, bitwiseOr, bitwiseOr, bitwiseXor, bitwiseXor, booleanValue, booleanValue, builder, byteValue, byteValue, charValue, charValue, conditional, conditional, divide, divide, doubleValue, doubleValue, eq, eq, extant, floatValue, floatValue, fromObject, ge, ge, gt, gt, integerValue, integerValue, intValue, intValue, inverse, isDefined, isDistinct, key, keyEquals, lambda, le, le, longValue, longValue, lt, lt, minus, minus, modulo, modulo, ne, ne, negative, not, numberValue, numberValue, or, or, plus, plus, positive, shortValue, shortValue, times, times, toValue
-
Methods inherited from class swim.structure.Item
appended, appended, appended, appended, appended, appended, cast, cast, coerce, coerce, display, evaluate, filter, filter, globalScope, invoke, max, min, precedence, prepended, prepended, prepended, prepended, prepended, prepended, substitute, toString, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updated, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedAttr, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot, updatedSlot
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Field Detail
-
effects
protected HashTrieMap<Value,KeyEffect> effects
-
outlets
protected HashTrieMap<Value,KeyOutlet<Value,Value>> outlets
-
version
protected int version
-
-
Method Detail
-
streamletScope
public StreamletScope<? extends Value> streamletScope()
Description copied from interface:StreamletScope
Returns the lexically scoped parent of thisStreamletScope
. Returnsnull
if thisStreamletScope
has no lexical parent.- Specified by:
streamletScope
in interfaceStreamletScope<Value>
-
streamletContext
public StreamletContext streamletContext()
Description copied from interface:StreamletScope
Returns the environment in which thisStreamletScope
operates.- Specified by:
streamletContext
in interfaceStreamletScope<Value>
-
containsOwnKey
public boolean containsOwnKey(Value key)
-
keyIterator
public abstract Iterator<Value> keyIterator()
Description copied from interface:MapOutlet
Returns anIterator
over the keys in the current state of thisMapOutlet
.- Specified by:
keyIterator
in interfaceMapOutlet<Value,Value,Record>
- Overrides:
keyIterator
in classRecord
-
get
public Record get()
Description copied from interface:Outlet
Returns the current state of thisOutlet
.
-
outlet
public Outlet<Value> outlet(Value key)
Description copied from interface:MapOutlet
Returns anOutlet
that updates when the specifiedkey
updates.
-
outlet
public Outlet<Value> outlet(String key)
Description copied from interface:StreamletScope
Returns anOutlet
that updates when the specifiedkey
updates.- Specified by:
outlet
in interfaceRecordOutlet
- Specified by:
outlet
in interfaceStreamletScope<Value>
-
outputIterator
public Iterator<Inlet<? super Record>> 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<Record>
-
bindOutput
public void bindOutput(Inlet<? super Record> 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<Record>
-
unbindOutput
public void unbindOutput(Inlet<? super Record> 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<Record>
-
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<Record>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:Outlet
Disconnects allOutlet
s dominated by thisOutlet
in the dataflow graph. Used to recursively clean up chains of combinators originating from thisInlet
.- Specified by:
disconnectOutputs
in interfaceOutlet<Record>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:Outlet
Disconnects allInlet
s dominated by thisOutlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators passing through thisOutlet
.- Specified by:
disconnectInputs
in interfaceOutlet<Record>
-
decohereInputKey
public void decohereInputKey(Value 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<Value,Value,Record>
-
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<Record>
-
recohereInputKey
public void recohereInputKey(Value 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<Value,Value,Record>
-
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<Record>
-
willDecohereInput
protected void willDecohereInput()
-
onDecohereInput
protected void onDecohereInput()
-
didDecohereInput
protected void didDecohereInput()
-
willRecohereInput
protected void willRecohereInput(int version)
-
onRecohereInput
protected void onRecohereInput(int version)
-
didRecohereInput
protected void didRecohereInput(int version)
-
-