java.lang.Object
swim.streamlet.AbstractStreamlet<I,O>
- All Implemented Interfaces:
GenericStreamlet<I,
,O> Streamlet<I,
,O> StreamletScope<O>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StreamletContext
protected StreamletScope<? extends O>
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Connects theInlet
of thisStreamlet
, identified by the givenkey
, to theinput
from which theInlet
should acquire its state.void
decohere()
Marks thisStreamlet
—and all of its outlets—as having inconsistent state.static <I,
O> void decohereOutlets
(Streamlet<I, O> streamlet, Class<?> streamletClass) protected void
void
didDecohereInlet
(Inlet<? extends I> inlet) void
didDecohereOutlet
(Outlet<? super O> outlet) protected void
didRecohere
(int version) void
didRecohereInlet
(Inlet<? extends I> inlet, int version) void
didRecohereOutlet
(Outlet<? super O> outlet, int version) void
Disconnects allInlet
s dominated by thisStreamlet
in the dataflow dependency graph.static <I,
O> void disconnectInputs
(Streamlet<I, O> streamlet, Class<?> streamletClass) void
Disconnects allInlets
s dominated by thisStreamlet
in the dataflow graph.static <I,
O> void disconnectOutputs
(Streamlet<I, O> streamlet, Class<?> streamletClass) <I2 extends I>
I2<I2 extends I>
I2<I2 extends I>
I2<I2 extends I>
I2inlet()
Returns theInlet
to thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchInlet
.inoutlet()
protected void
protected void
protected void
onRecohere
(int version) protected void
onRecohereInlets
(int version) protected void
onRecohereOutlets
(int version) protected <O2> Outlet<O2>
outlet()
Returns theOutlet
of thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchOutlet
.void
recohere
(int version) Updates the state of thisStreamlet
to make it consistent with the targetversion
.static <I,
O> void recohereInlets
(int version, Streamlet<I, O> streamlet, Class<?> streamletClass) static <I,
O> void recohereOutlets
(int version, Streamlet<I, O> streamlet, Class<?> streamletClass) static <I,
O> int reflectInletCount
(Class<?> streamletClass) static <I,
O> Inlet<I> reflectInletField
(Streamlet<I, O> streamlet, Field field) reflectInletIndex
(int index, Streamlet<I, O> streamlet, Class<?> streamletClass) static <I,
O> Inlet<I> reflectInletKey
(String key, Streamlet<I, O> streamlet, Class<?> streamletClass) static <I,
O> Inoutlet<I, O> reflectInoutletField
(Streamlet<I, O> streamlet, Field field) static <I,
O> int reflectOutletCount
(Class<?> streamletClass) static <I,
O> Outlet<O> reflectOutletField
(Streamlet<I, O> streamlet, Field field) reflectOutletIndex
(int index, Streamlet<I, O> streamlet, Class<?> streamletClass) static <I,
O> Outlet<O> reflectOutletKey
(String key, Streamlet<I, O> streamlet, Class<?> streamletClass) void
setStreamletContext
(StreamletContext context) Sets the environment in which thisStreamlet
operates.void
setStreamletScope
(StreamletScope<? extends O> scope) Sets the lexically scoped parent of thisStreamlet
.Returns the environment in which thisStreamlet
operates.StreamletScope<? extends O>
Returns the lexically scoped parent of thisStreamlet
.void
unbindInput
(String key) Disconnects theInlet
of thisStreamlet
, identified by the givenkey
, from itsinput
Outlet
, if connected.protected void
void
willDecohereInlet
(Inlet<? extends I> inlet) void
willDecohereOutlet
(Outlet<? super O> outlet) protected void
willRecohere
(int version) void
willRecohereInlet
(Inlet<? extends I> inlet, int version) void
willRecohereOutlet
(Outlet<? super O> outlet, int version)
-
Field Details
-
scope
-
context
-
version
protected int version
-
-
Constructor Details
-
AbstractStreamlet
-
AbstractStreamlet
public AbstractStreamlet()
-
-
Method Details
-
streamletScope
Description copied from interface:Streamlet
Returns the lexically scoped parent of thisStreamlet
. Returnsnull
if thisStreamlet
has no lexical parent.- Specified by:
streamletScope
in interfaceStreamlet<I,
O> - Specified by:
streamletScope
in interfaceStreamletScope<I>
-
setStreamletScope
Description copied from interface:Streamlet
Sets the lexically scoped parent of thisStreamlet
.- Specified by:
setStreamletScope
in interfaceStreamlet<I,
O>
-
streamletContext
Description copied from interface:Streamlet
Returns the environment in which thisStreamlet
operates.- Specified by:
streamletContext
in interfaceStreamlet<I,
O> - Specified by:
streamletContext
in interfaceStreamletScope<I>
-
setStreamletContext
Description copied from interface:Streamlet
Sets the environment in which thisStreamlet
operates.- Specified by:
setStreamletContext
in interfaceStreamlet<I,
O>
-
inlet
Description copied from interface:Streamlet
Returns theInlet
to thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchInlet
. -
inlet
-
bindInput
Description copied from interface:Streamlet
Connects theInlet
of thisStreamlet
, identified by the givenkey
, to theinput
from which theInlet
should acquire its state. Delegates toInlet.bindInput(Outlet)
on the identifiedInlet
. -
unbindInput
Description copied from interface:Streamlet
Disconnects theInlet
of thisStreamlet
, identified by the givenkey
, from itsinput
Outlet
, if connected. Delegates toInlet.unbindInput()
on the identifiedInlet
.- Specified by:
unbindInput
in interfaceStreamlet<I,
O>
-
outlet
Description copied from interface:Streamlet
Returns theOutlet
of thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchOutlet
. -
outlet
-
inoutlet
-
decohere
public void decohere()Description copied from interface:Streamlet
Marks thisStreamlet
—and all of its outlets—as having inconsistent state. Decohering aStreamlet
will recursively decohere all streamlets that transitively depend on the state of thisStreamlet
. Decohering aStreamlet
does not cause its state to be recomputed. A subsequentStreamlet.recohere(int)
call will eventually make the state of theStreamlet
coherent again. -
recohere
public void recohere(int version) Description copied from interface:Streamlet
Updates the state of thisStreamlet
to make it consistent with the targetversion
. TheStreamlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theStreamlet
first invokesInlet.recohereOutput(int)
on each of its inlets, to ensure that its input states are coherent. It then recomputes its own state in an implementation defined manner. Finally, it invokesOutlet.recohereInput(int)
on its outlets, causing all transitively dependent streamlets to make their own states coherent again. -
getInput
-
getInput
-
getInput
-
getInput
-
getOutput
- Specified by:
getOutput
in interfaceGenericStreamlet<I,
O>
-
getOutput
-
disconnectInputs
public void disconnectInputs()Description copied from interface:Streamlet
Disconnects allInlet
s dominated by thisStreamlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisStreamlet
.- Specified by:
disconnectInputs
in interfaceStreamlet<I,
O>
-
disconnectOutputs
public void disconnectOutputs()Description copied from interface:Streamlet
Disconnects allInlets
s dominated by thisStreamlet
in the dataflow graph. Used to recursively clean up chains of combinators originating from thisStreamlet
.- Specified by:
disconnectOutputs
in interfaceStreamlet<I,
O>
-
willDecohereInlet
- Specified by:
willDecohereInlet
in interfaceGenericStreamlet<I,
O>
-
didDecohereInlet
- Specified by:
didDecohereInlet
in interfaceGenericStreamlet<I,
O>
-
willRecohereInlet
- Specified by:
willRecohereInlet
in interfaceGenericStreamlet<I,
O>
-
didRecohereInlet
- Specified by:
didRecohereInlet
in interfaceGenericStreamlet<I,
O>
-
willDecohereOutlet
- Specified by:
willDecohereOutlet
in interfaceGenericStreamlet<I,
O>
-
didDecohereOutlet
- Specified by:
didDecohereOutlet
in interfaceGenericStreamlet<I,
O>
-
willRecohereOutlet
- Specified by:
willRecohereOutlet
in interfaceGenericStreamlet<I,
O>
-
didRecohereOutlet
- Specified by:
didRecohereOutlet
in interfaceGenericStreamlet<I,
O>
-
willDecohere
protected void willDecohere() -
onDecohere
protected void onDecohere() -
onDecohereOutlets
protected void onDecohereOutlets() -
didDecohere
protected void didDecohere() -
willRecohere
protected void willRecohere(int version) -
onRecohereInlets
protected void onRecohereInlets(int version) -
onRecohere
protected void onRecohere(int version) -
onRecohereOutlets
protected void onRecohereOutlets(int version) -
didRecohere
protected void didRecohere(int version) -
disconnectInputs
-
disconnectOutputs
-
decohereOutlets
-
recohereInlets
-
recohereOutlets
-
reflectInletCount
-
reflectOutletCount
-
reflectInletIndex
-
reflectOutletIndex
-
reflectInletKey
-
reflectOutletKey
-
reflectInletField
-
reflectOutletField
-
reflectInoutletField
-