Duplicating processors and observing what happens to their Context object.
More...
|
static void | main (String[] args) |
|
Duplicating processors and observing what happens to their Context object.
- Author
- Sylvain Hallé Easy
Definition at line 36 of file DuplicateContext.java.
◆ main()
static void basic.DuplicateContext.main |
( |
String [] |
args | ) |
|
|
static |
We first create an ApplyFunction that simply adds
Definition at line 38 of file DuplicateContext.java.
42 ApplyFunction f1 =
new ApplyFunction(
new FunctionTree(
43 Numbers.addition, StreamVariable.X,
new ContextVariable(
"foo")));
44 Connector.connect(f1,
new Print()
45 .setPrefix(
"f1: ").setSeparator(
"\n"));
48 Pushable p_f1 = f1.getPushableInput();
49 f1.setContext(
"foo", 10);
53 ApplyFunction f2 = (ApplyFunction) f1.duplicate();
54 Connector.connect(f2,
new Print()
55 .setPrefix(
"f2: ").setSeparator(
"\n"));
56 Pushable p_f2 = f2.getPushableInput();
57 p_f2.push(2).push(7).push(1);
The documentation for this class was generated from the following file: