- 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
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)
protected void
didInvalidateInput()
protected void
didInvalidateInputKey(Value key, KeyEffect effect)
protected void
didReconcileInput(int version)
protected void
didReconcileInputKey(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
.void
invalidateInput()
void
invalidateInputKey(Value key, KeyEffect effect)
Marks thisMapOutlet
as needing aneffect
applied to a givenkey
.abstract Iterator<Value>
keyIterator()
Returns anIterator
over the keys in the current state of thisMapOutlet
.protected void
onInvalidateInput()
protected void
onInvalidateInputKey(Value key, KeyEffect effect)
protected void
onReconcileInput(int version)
protected void
onReconcileInputKey(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
reconcileInput(int version)
Reconciles the state of thisOutlet
, if the version of thisOutlet
's state differs from the targetversion
.void
reconcileInputKey(Value key, int version)
Reconciles the state of an individualkey
in thisMapOutlet
, if the version of thisMapOutlet
's state differs from 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
willInvalidateInput()
protected void
willInvalidateInputKey(Value key, KeyEffect effect)
protected void
willReconcileInput(int version)
protected void
willReconcileInputKey(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, 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, 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 invalidated when the state of thisOutlet
is invalidated, and updated when thisOutlet
is updated.- 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>
-
invalidateInputKey
public void invalidateInputKey(Value key, KeyEffect effect)
Description copied from interface:MapOutlet
Marks thisMapOutlet
as needing aneffect
applied to a givenkey
. Invalidating an individual key invalidates the entire state of theOutlet
. But only the invalidated keys need to be updated in order to reconcile the overall state of theOutlet
.- Specified by:
invalidateInputKey
in interfaceMapOutlet<Value,Value,Record>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet
- Specified by:
invalidateInput
in interfaceOutlet<Record>
-
reconcileInputKey
public void reconcileInputKey(Value key, int version)
Description copied from interface:MapOutlet
Reconciles the state of an individualkey
in thisMapOutlet
, if the version of thisMapOutlet
's state differs from the targetversion
. To reconcile the state of a key, theMapOutlet
first invokesStreamlet.reconcile(int)
on its attached streamlets. Then, for each dependent output, it invokesMapInlet.reconcileOutputKey(Object, int)
, if the dependent output is aMapInlet
, or it invokesInlet.reconcileOutput(int)
, if the dependent output is not aMapInlet
.- Specified by:
reconcileInputKey
in interfaceMapOutlet<Value,Value,Record>
-
reconcileInput
public void reconcileInput(int version)
Description copied from interface:Outlet
Reconciles the state of thisOutlet
, if the version of thisOutlet
's state differs from the targetversion
. To reconcile its state, theOutlet
first invokesStreamlet.reconcile(int)
on theStreamlet
to which it's attached. It then invokesInlet.reconcileOutput(int)
on each of its dependentoutputs
.- Specified by:
reconcileInput
in interfaceOutlet<Record>
-
willInvalidateInput
protected void willInvalidateInput()
-
onInvalidateInput
protected void onInvalidateInput()
-
didInvalidateInput
protected void didInvalidateInput()
-
willReconcileInputKey
protected void willReconcileInputKey(Value key, KeyEffect effect, int version)
-
willReconcileInput
protected void willReconcileInput(int version)
-
onReconcileInput
protected void onReconcileInput(int version)
-
didReconcileInput
protected void didReconcileInput(int version)
-
-