- 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 voidbindOutput(Inlet<? super Record> output)Adds anoutputto the set ofInlets that depend on the state of thisOutlet.booleancontainsOwnKey(Value key)voiddecohereInput()Marks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voiddecohereInputKey(Value key, KeyEffect effect)Marks thisMapOutletas needing aneffectapplied to a givenkey.protected voiddidDecohereInput()protected voiddidDecohereInputKey(Value key, KeyEffect effect)protected voiddidRecohereInput(int version)protected voiddidRecohereInputKey(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.abstract Iterator<Value>keyIterator()Returns anIteratorover the keys in the current state of thisMapOutlet.protected voidonDecohereInput()protected voidonDecohereInputKey(Value key, KeyEffect effect)protected voidonRecohereInput(int version)protected voidonRecohereInputKey(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.voidrecohereInput(int version)Updates the state of thisOutletto make it consistent with the targetversion.voidrecohereInputKey(Value key, int version)Updates the state of an individualkeyin thisMapOutletto make it consistent with 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 voidwillDecohereInput()protected voidwillDecohereInputKey(Value key, KeyEffect effect)protected voidwillRecohereInput(int version)protected voidwillRecohereInputKey(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, 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: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 decohered when the state of thisOutletis decohered, and recohered when thisOutletis recohered.- 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>
-
decohereInputKey
public void decohereInputKey(Value key, KeyEffect effect)
Description copied from interface:MapOutletMarks thisMapOutletas needing aneffectapplied 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:
decohereInputKeyin interfaceMapOutlet<Value,Value,Record>
-
decohereInput
public void decohereInput()
Description copied from interface:OutletMarks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.- Specified by:
decohereInputin interfaceOutlet<Record>
-
recohereInputKey
public void recohereInputKey(Value key, int version)
Description copied from interface:MapOutletUpdates the state of an individualkeyin thisMapOutletto make it consistent with the targetversion. TheMapOutletonly needs to update if its currentversiondiffers from the targetversion. To update the state of a key, theMapOutletfirst 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:
recohereInputKeyin interfaceMapOutlet<Value,Value,Record>
-
recohereInput
public void recohereInput(int version)
Description copied from interface:OutletUpdates the state of thisOutletto make it consistent with the targetversion. TheOutletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theOutletfirst invokesStreamlet.recohere(int)on theStreamletto which it's attached. It then invokesInlet.recohereOutput(int)on each of its dependentoutputs.- Specified by:
recohereInputin 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)
-
-