- java.lang.Object
-
- swim.system.DownlinkView
-
- swim.system.warp.WarpDownlinkView
-
- swim.system.downlink.ValueDownlinkView<V>
-
- All Implemented Interfaces:
Downlink,ValueDownlink<V>,Link,WarpDownlink,WarpLink,Observable<Object>,ObservableValue<V>,Inlet<V>,Outlet<V>,Log
- Direct Known Subclasses:
JoinValueLaneDownlink
public class ValueDownlinkView<V> extends WarpDownlinkView implements ValueDownlink<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected Outlet<? extends V>inputprotected ValueDownlinkModelmodelprotected Inlet<? super V>[]outputsprotected static intSTATEFULprotected Form<V>valueFormprotected intversion-
Fields inherited from class swim.system.warp.WarpDownlinkView
body, flags, hostUri, KEEP_LINKED, KEEP_SYNCED, laneUri, meshUri, nodeUri, prio, rate
-
Fields inherited from class swim.system.DownlinkView
cellContext, observers, stage
-
-
Constructor Summary
Constructors Constructor Description ValueDownlinkView(CellContext cellContext, Stage stage, Uri meshUri, Uri hostUri, Uri nodeUri, Uri laneUri, float prio, float rate, Value body, int flags, Form<V> valueForm, Object observers)ValueDownlinkView(CellContext cellContext, Stage stage, Uri meshUri, Uri hostUri, Uri nodeUri, Uri laneUri, float prio, float rate, Value body, Form<V> valueForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindInput(Outlet<? extends V> input)Connects thisInletto anOutletfrom which it will acquire its state.voidbindOutput(Inlet<? super V> output)Adds anoutputto the set ofInlets that depend on the state of thisOutlet.ValueDownlinkView<V>body(Value body)voidclose()ValueDownlinkModelcreateDownlinkModel()voiddecohere()voiddecohereInput()Marks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voiddecohereOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state.ValueDownlinkView<V>didClose(DidClose didClose)ValueDownlinkView<V>didConnect(DidConnect didConnect)protected voiddidDecohere()ValueDownlinkView<V>didDisconnect(DidDisconnect didDisconnect)ValueDownlinkView<V>didFail(DidFail didFail)ValueDownlinkView<V>didLink(DidLink didLink)ValueDownlinkView<V>didReceive(DidReceive didReceive)protected voiddidRecohere(int version)ValueDownlinkView<V>didSet(DidSet<V> didSet)ValueDownlinkView<V>didSync(DidSync didSync)ValueDownlinkView<V>didUnlink(DidUnlink didUnlink)voiddisconnectInputs()Disconnects allInlets dominated by thisInletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allOutlets dominated by thisInletin the dataflow graph.booleandispatchDidSet(V newValue, V oldValue, boolean preemptive)Map.Entry<Boolean,V>dispatchWillSet(V newValue, boolean preemptive)voiddownlinkDidSet(V newValue, V oldValue)voiddownlinkDidSetValue(Value newValue, Value oldValue)ValueDownlinkModeldownlinkModel()VdownlinkWillSet(V newValue)ValuedownlinkWillSetValue(Value newValue)Vget()Returns the current state of thisOutlet.ValueDownlinkView<V>hostUri(String hostUri)ValueDownlinkView<V>hostUri(Uri hostUri)Outlet<? extends V>input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.booleanisStateful()ValueDownlinkView<V>isStateful(boolean isStateful)ValueDownlinkView<V>keepLinked(boolean keepLinked)ValueDownlinkView<V>keepSynced(boolean keepSynced)ValueDownlinkView<V>laneUri(String laneUri)ValueDownlinkView<V>laneUri(Uri laneUri)ValueDownlinkView<V>nodeUri(String nodeUri)ValueDownlinkView<V>nodeUri(Uri nodeUri)ValueDownlinkView<V>observe(Object observer)protected voidonDecohere()protected voidonRecohere(int version)ValueDownlinkView<V>open()Iterator<Inlet<? super V>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.ValueDownlinkView<V>prio(float prio)ValueDownlinkView<V>rate(float rate)voidrecohere(int version)voidrecohereInput(int version)Updates the state of thisOutletto make it consistent with the targetversion.voidrecohereOutput(int version)Updates the state of thisInletto make it consistent with thetargetversion.Vset(V newValue)protected ObjecttypesafeObservers(Object observers)voidunbindInput()Disconnects thisInletfrom its inputOutlet, if connected.voidunbindOutput(Inlet<? super V> 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.ValueDownlinkView<V>unobserve(Object observer)<V2> ValueDownlinkView<V2>valueClass(Class<V2> valueClass)Form<V>valueForm()<V2> ValueDownlinkView<V2>valueForm(Form<V2> valueForm)ValueDownlinkView<V>willCommand(WillCommand willCommand)protected voidwillDecohere()ValueDownlinkView<V>willLink(WillLink willLink)ValueDownlinkView<V>willReceive(WillReceive willReceive)protected voidwillRecohere(int version)ValueDownlinkView<V>willSet(WillSet<V> willSet)ValueDownlinkView<V>willSync(WillSync willSync)ValueDownlinkView<V>willUnlink(WillUnlink willUnlink)-
Methods inherited from class swim.system.warp.WarpDownlinkView
body, command, command, command, command, dispatchDidLink, dispatchDidReceive, dispatchDidSync, dispatchDidUnlink, dispatchWillCommand, dispatchWillLink, dispatchWillReceive, dispatchWillSync, dispatchWillUnlink, downlinkDidLink, downlinkDidReceive, downlinkDidSync, downlinkDidUnlink, downlinkWillCommand, downlinkWillLink, downlinkWillReceive, downlinkWillSync, downlinkWillUnlink, hostUri, keepLinked, keepSynced, laneUri, meshUri, nodeUri, prio, rate
-
Methods inherited from class swim.system.DownlinkView
cellContext, cipherSuite, debug, dispatchDidClose, dispatchDidConnect, dispatchDidDisconnect, dispatchDidFail, downlinkDidClose, downlinkDidConnect, downlinkDidDisconnect, downlinkDidFail, error, fail, info, isConnected, isRemote, isSecure, localAddress, localCertificates, localIdentity, localPrincipal, remoteAddress, remoteCertificates, remoteIdentity, remotePrincipal, securityProtocol, stage, trace, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface swim.api.Link
cipherSuite, hostUri, isConnected, isRemote, isSecure, laneUri, localAddress, localCertificates, localIdentity, localPrincipal, nodeUri, remoteAddress, remoteCertificates, remoteIdentity, remotePrincipal, securityProtocol
-
Methods inherited from interface swim.api.warp.WarpDownlink
body, command, command, command, command, keepLinked, keepSynced, prio, rate
-
-
-
-
Field Detail
-
model
protected ValueDownlinkModel model
-
version
protected int version
-
STATEFUL
protected static final int STATEFUL
- See Also:
- Constant Field Values
-
-
Method Detail
-
downlinkModel
public ValueDownlinkModel downlinkModel()
- Specified by:
downlinkModelin classWarpDownlinkView
-
hostUri
public ValueDownlinkView<V> hostUri(Uri hostUri)
- Specified by:
hostUriin interfaceValueDownlink<V>- Specified by:
hostUriin interfaceWarpDownlink- Specified by:
hostUriin classWarpDownlinkView
-
hostUri
public ValueDownlinkView<V> hostUri(String hostUri)
- Specified by:
hostUriin interfaceValueDownlink<V>- Specified by:
hostUriin interfaceWarpDownlink- Specified by:
hostUriin classWarpDownlinkView
-
nodeUri
public ValueDownlinkView<V> nodeUri(Uri nodeUri)
- Specified by:
nodeUriin interfaceValueDownlink<V>- Specified by:
nodeUriin interfaceWarpDownlink- Specified by:
nodeUriin classWarpDownlinkView
-
nodeUri
public ValueDownlinkView<V> nodeUri(String nodeUri)
- Specified by:
nodeUriin interfaceValueDownlink<V>- Specified by:
nodeUriin interfaceWarpDownlink- Specified by:
nodeUriin classWarpDownlinkView
-
laneUri
public ValueDownlinkView<V> laneUri(Uri laneUri)
- Specified by:
laneUriin interfaceValueDownlink<V>- Specified by:
laneUriin interfaceWarpDownlink- Specified by:
laneUriin classWarpDownlinkView
-
laneUri
public ValueDownlinkView<V> laneUri(String laneUri)
- Specified by:
laneUriin interfaceValueDownlink<V>- Specified by:
laneUriin interfaceWarpDownlink- Specified by:
laneUriin classWarpDownlinkView
-
prio
public ValueDownlinkView<V> prio(float prio)
- Specified by:
prioin interfaceValueDownlink<V>- Specified by:
prioin interfaceWarpDownlink- Specified by:
prioin classWarpDownlinkView
-
rate
public ValueDownlinkView<V> rate(float rate)
- Specified by:
ratein interfaceValueDownlink<V>- Specified by:
ratein interfaceWarpDownlink- Specified by:
ratein classWarpDownlinkView
-
body
public ValueDownlinkView<V> body(Value body)
- Specified by:
bodyin interfaceValueDownlink<V>- Specified by:
bodyin interfaceWarpDownlink- Specified by:
bodyin classWarpDownlinkView
-
keepLinked
public ValueDownlinkView<V> keepLinked(boolean keepLinked)
- Specified by:
keepLinkedin interfaceValueDownlink<V>- Specified by:
keepLinkedin interfaceWarpDownlink- Specified by:
keepLinkedin classWarpDownlinkView
-
keepSynced
public ValueDownlinkView<V> keepSynced(boolean keepSynced)
- Specified by:
keepSyncedin interfaceValueDownlink<V>- Specified by:
keepSyncedin interfaceWarpDownlink- Specified by:
keepSyncedin classWarpDownlinkView
-
isStateful
public final boolean isStateful()
- Specified by:
isStatefulin interfaceValueDownlink<V>
-
isStateful
public ValueDownlinkView<V> isStateful(boolean isStateful)
- Specified by:
isStatefulin interfaceValueDownlink<V>
-
valueForm
public final Form<V> valueForm()
- Specified by:
valueFormin interfaceValueDownlink<V>
-
valueForm
public <V2> ValueDownlinkView<V2> valueForm(Form<V2> valueForm)
- Specified by:
valueFormin interfaceValueDownlink<V>
-
valueClass
public <V2> ValueDownlinkView<V2> valueClass(Class<V2> valueClass)
- Specified by:
valueClassin interfaceValueDownlink<V>
-
observe
public ValueDownlinkView<V> observe(Object observer)
- Specified by:
observein interfaceDownlink- Specified by:
observein interfaceLink- Specified by:
observein interfaceObservable<V>- Specified by:
observein interfaceObservableValue<V>- Specified by:
observein interfaceValueDownlink<V>- Specified by:
observein interfaceWarpDownlink- Overrides:
observein classWarpDownlinkView
-
unobserve
public ValueDownlinkView<V> unobserve(Object observer)
- Specified by:
unobservein interfaceDownlink- Specified by:
unobservein interfaceLink- Specified by:
unobservein interfaceObservable<V>- Specified by:
unobservein interfaceObservableValue<V>- Specified by:
unobservein interfaceValueDownlink<V>- Specified by:
unobservein interfaceWarpDownlink- Overrides:
unobservein classWarpDownlinkView
-
willSet
public ValueDownlinkView<V> willSet(WillSet<V> willSet)
- Specified by:
willSetin interfaceObservableValue<V>- Specified by:
willSetin interfaceValueDownlink<V>
-
didSet
public ValueDownlinkView<V> didSet(DidSet<V> didSet)
- Specified by:
didSetin interfaceObservableValue<V>- Specified by:
didSetin interfaceValueDownlink<V>
-
willReceive
public ValueDownlinkView<V> willReceive(WillReceive willReceive)
- Specified by:
willReceivein interfaceValueDownlink<V>- Specified by:
willReceivein interfaceWarpDownlink- Specified by:
willReceivein classWarpDownlinkView
-
didReceive
public ValueDownlinkView<V> didReceive(DidReceive didReceive)
- Specified by:
didReceivein interfaceValueDownlink<V>- Specified by:
didReceivein interfaceWarpDownlink- Specified by:
didReceivein classWarpDownlinkView
-
willCommand
public ValueDownlinkView<V> willCommand(WillCommand willCommand)
- Specified by:
willCommandin interfaceValueDownlink<V>- Specified by:
willCommandin interfaceWarpDownlink- Specified by:
willCommandin classWarpDownlinkView
-
willLink
public ValueDownlinkView<V> willLink(WillLink willLink)
- Specified by:
willLinkin interfaceValueDownlink<V>- Specified by:
willLinkin interfaceWarpDownlink- Specified by:
willLinkin classWarpDownlinkView
-
didLink
public ValueDownlinkView<V> didLink(DidLink didLink)
- Specified by:
didLinkin interfaceValueDownlink<V>- Specified by:
didLinkin interfaceWarpDownlink- Specified by:
didLinkin classWarpDownlinkView
-
willSync
public ValueDownlinkView<V> willSync(WillSync willSync)
- Specified by:
willSyncin interfaceValueDownlink<V>- Specified by:
willSyncin interfaceWarpDownlink- Specified by:
willSyncin classWarpDownlinkView
-
didSync
public ValueDownlinkView<V> didSync(DidSync didSync)
- Specified by:
didSyncin interfaceValueDownlink<V>- Specified by:
didSyncin interfaceWarpDownlink- Specified by:
didSyncin classWarpDownlinkView
-
willUnlink
public ValueDownlinkView<V> willUnlink(WillUnlink willUnlink)
- Specified by:
willUnlinkin interfaceValueDownlink<V>- Specified by:
willUnlinkin interfaceWarpDownlink- Specified by:
willUnlinkin classWarpDownlinkView
-
didUnlink
public ValueDownlinkView<V> didUnlink(DidUnlink didUnlink)
- Specified by:
didUnlinkin interfaceValueDownlink<V>- Specified by:
didUnlinkin interfaceWarpDownlink- Specified by:
didUnlinkin classWarpDownlinkView
-
didConnect
public ValueDownlinkView<V> didConnect(DidConnect didConnect)
- Specified by:
didConnectin interfaceDownlink- Specified by:
didConnectin interfaceValueDownlink<V>- Specified by:
didConnectin interfaceWarpDownlink- Specified by:
didConnectin classWarpDownlinkView
-
didDisconnect
public ValueDownlinkView<V> didDisconnect(DidDisconnect didDisconnect)
- Specified by:
didDisconnectin interfaceDownlink- Specified by:
didDisconnectin interfaceValueDownlink<V>- Specified by:
didDisconnectin interfaceWarpDownlink- Specified by:
didDisconnectin classWarpDownlinkView
-
didClose
public ValueDownlinkView<V> didClose(DidClose didClose)
- Specified by:
didClosein interfaceDownlink- Specified by:
didClosein interfaceValueDownlink<V>- Specified by:
didClosein interfaceWarpDownlink- Specified by:
didClosein classWarpDownlinkView
-
didFail
public ValueDownlinkView<V> didFail(DidFail didFail)
- Specified by:
didFailin interfaceDownlink- Specified by:
didFailin interfaceValueDownlink<V>- Specified by:
didFailin interfaceWarpDownlink- Specified by:
didFailin classWarpDownlinkView
-
createDownlinkModel
public ValueDownlinkModel createDownlinkModel()
- Specified by:
createDownlinkModelin classWarpDownlinkView
-
open
public ValueDownlinkView<V> open()
- Specified by:
openin interfaceDownlink- Specified by:
openin interfaceValueDownlink<V>- Specified by:
openin interfaceWarpDownlink- Specified by:
openin classWarpDownlinkView
-
close
public void close()
- Specified by:
closein interfaceLink- Overrides:
closein classDownlinkView
-
get
public V get()
Description copied from interface:OutletReturns the current state of thisOutlet.- Specified by:
getin interfaceObservableValue<V>- Specified by:
getin interfaceOutlet<V>- Specified by:
getin interfaceValueDownlink<V>
-
set
public V set(V newValue)
- Specified by:
setin interfaceObservableValue<V>- Specified by:
setin interfaceValueDownlink<V>
-
input
public Outlet<? extends V> input()
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.
-
bindInput
public void bindInput(Outlet<? extends V> input)
Description copied from interface:InletConnects thisInletto anOutletfrom which it will acquire its state. If thisInletis already connected, it will first disconnect from its existing input. Then, after updating itsinputproperty, theInletwill invokeOutlet.bindOutput(Inlet)on its newinput.
-
unbindInput
public void unbindInput()
Description copied from interface:InletDisconnects thisInletfrom its inputOutlet, if connected. After setting itsinputproperty tonull, theInletwill invokeOutlet.unbindOutput(Inlet)on its old input, if defined.- Specified by:
unbindInputin interfaceInlet<V>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:InletDisconnects allInlets dominated by thisInletin the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet.- Specified by:
disconnectInputsin interfaceInlet<V>- Specified by:
disconnectInputsin interfaceOutlet<V>
-
outputIterator
public Iterator<Inlet<? super V>> outputIterator()
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<V>
-
bindOutput
public void bindOutput(Inlet<? super V> 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<V>
-
unbindOutput
public void unbindOutput(Inlet<? super V> output)
Description copied from interface:OutletRemoves anoutputfrom the set ofInlets that depend on the state of thisOutlet.- Specified by:
unbindOutputin interfaceOutlet<V>
-
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<V>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:InletDisconnects allOutlets dominated by thisInletin the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet.- Specified by:
disconnectOutputsin interfaceInlet<V>- Specified by:
disconnectOutputsin interfaceOutlet<V>
-
decohereOutput
public void decohereOutput()
Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state. Decohering anInletwill recursively decohere all streamlets that transitively depend on the state of thisInlet. Decohering anInletdoes not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)call will eventually make the state of theInletcoherent again.- Specified by:
decohereOutputin interfaceInlet<V>
-
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<V>
-
decohere
public void decohere()
-
recohereOutput
public void recohereOutput(int version)
Description copied from interface:InletUpdates the state of thisInletto make it consistent with thetargetversion. TheInletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theInletfirst invokesOutlet.recohereInput(int)on itsinput, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)on theStreamletto which it's attached, causing theStreamletto make its own state coherent again.- Specified by:
recohereOutputin interfaceInlet<V>
-
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<V>
-
recohere
public void recohere(int version)
-
willDecohere
protected void willDecohere()
-
onDecohere
protected void onDecohere()
-
didDecohere
protected void didDecohere()
-
willRecohere
protected void willRecohere(int version)
-
onRecohere
protected void onRecohere(int version)
-
didRecohere
protected void didRecohere(int version)
-
-