- 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 voidbindOutput(Inlet<? super Record> output)Adds anoutputto the set ofInlets that depend on the state of thisOutlet.booleancontainsOwnKey(Value key)protected voiddidInvalidateInput()protected voiddidInvalidateInputKey(Value key, KeyEffect effect)protected voiddidReconcileInput(int version)protected voiddidReconcileInputKey(Value key, KeyEffect effect, int version)voiddisconnectInputs()Disconnects allInlets dominated by thisOutletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allOutlets dominated by thisOutletin the dataflow graph.Recordget()Returns the current state of thisOutlet.voidinvalidateInput()voidinvalidateInputKey(Value key, KeyEffect effect)Marks thisMapOutletas needing aneffectapplied to a givenkey.abstract Iterator<Value>keyIterator()Returns anIteratorover the keys in the current state of thisMapOutlet.protected voidonInvalidateInput()protected voidonInvalidateInputKey(Value key, KeyEffect effect)protected voidonReconcileInput(int version)protected voidonReconcileInputKey(Value key, KeyEffect effect, int version)Outlet<Value>outlet(String key)Returns anOutletthat updates when the specifiedkeyupdates.Outlet<Value>outlet(Value key)Returns anOutletthat updates when the specifiedkeyupdates.Iterator<Inlet<? super Record>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidreconcileInput(int version)Reconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion.voidreconcileInputKey(Value key, int version)Reconciles the state of an individualkeyin thisMapOutlet, if the version of thisMapOutlet's state differs from the targetversion.StreamletContextstreamletContext()Returns the environment in which thisStreamletScopeoperates.StreamletScope<? extends Value>streamletScope()Returns the lexically scoped parent of thisStreamletScope.voidunbindOutput(Inlet<? super Record> output)Removes anoutputfrom the set ofInlets that depend on the state of thisOutlet.voidunbindOutputs()Disconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.protected voidwillInvalidateInput()protected voidwillInvalidateInputKey(Value key, KeyEffect effect)protected voidwillReconcileInput(int version)protected voidwillReconcileInputKey(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:StreamletScopeReturns the lexically scoped parent of thisStreamletScope. Returnsnullif thisStreamletScopehas no lexical parent.- Specified by:
streamletScopein interfaceStreamletScope<Value>
-
streamletContext
public StreamletContext streamletContext()
Description copied from interface:StreamletScopeReturns the environment in which thisStreamletScopeoperates.- Specified by:
streamletContextin interfaceStreamletScope<Value>
-
containsOwnKey
public boolean containsOwnKey(Value key)
-
keyIterator
public abstract Iterator<Value> keyIterator()
Description copied from interface:MapOutletReturns anIteratorover the keys in the current state of thisMapOutlet.- Specified by:
keyIteratorin interfaceMapOutlet<Value,Value,Record>- Overrides:
keyIteratorin classRecord
-
get
public Record get()
Description copied from interface:OutletReturns the current state of thisOutlet.
-
outlet
public Outlet<Value> outlet(Value key)
Description copied from interface:MapOutletReturns anOutletthat updates when the specifiedkeyupdates.
-
outlet
public Outlet<Value> outlet(String key)
Description copied from interface:StreamletScopeReturns anOutletthat updates when the specifiedkeyupdates.- Specified by:
outletin interfaceRecordOutlet- Specified by:
outletin interfaceStreamletScope<Value>
-
outputIterator
public Iterator<Inlet<? super Record>> outputIterator()
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<Record>
-
bindOutput
public void bindOutput(Inlet<? super Record> output)
Description copied from interface:OutletAdds anoutputto the set ofInlets that depend on the state of thisOutlet. Theoutputwill be invalidated when the state of thisOutletis invalidated, and updated when thisOutletis updated.- Specified by:
bindOutputin interfaceOutlet<Record>
-
unbindOutput
public void unbindOutput(Inlet<? super Record> output)
Description copied from interface:OutletRemoves anoutputfrom the set ofInlets that depend on the state of thisOutlet.- Specified by:
unbindOutputin interfaceOutlet<Record>
-
unbindOutputs
public void unbindOutputs()
Description copied from interface:OutletDisconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.- Specified by:
unbindOutputsin interfaceOutlet<Record>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:OutletDisconnects allOutlets dominated by thisOutletin the dataflow graph. Used to recursively clean up chains of combinators originating from thisInlet.- Specified by:
disconnectOutputsin interfaceOutlet<Record>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:OutletDisconnects allInlets dominated by thisOutletin the dataflow dependency graph. Used to recursively clean up chains of combinators passing through thisOutlet.- Specified by:
disconnectInputsin interfaceOutlet<Record>
-
invalidateInputKey
public void invalidateInputKey(Value key, KeyEffect effect)
Description copied from interface:MapOutletMarks thisMapOutletas needing aneffectapplied 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:
invalidateInputKeyin interfaceMapOutlet<Value,Value,Record>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet- Specified by:
invalidateInputin interfaceOutlet<Record>
-
reconcileInputKey
public void reconcileInputKey(Value key, int version)
Description copied from interface:MapOutletReconciles the state of an individualkeyin thisMapOutlet, if the version of thisMapOutlet's state differs from the targetversion. To reconcile the state of a key, theMapOutletfirst 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:
reconcileInputKeyin interfaceMapOutlet<Value,Value,Record>
-
reconcileInput
public void reconcileInput(int version)
Description copied from interface:OutletReconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion. To reconcile its state, theOutletfirst invokesStreamlet.reconcile(int)on theStreamletto which it's attached. It then invokesInlet.reconcileOutput(int)on each of its dependentoutputs.- Specified by:
reconcileInputin 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)
-
-