Duplicating processors without preserving their state.
More...
|
static void | main (String[] args) |
|
Duplicating processors without preserving their state.
- Author
- Sylvain Hallé Easy
Definition at line 33 of file DuplicateNoState.java.
◆ main()
static void basic.DuplicateNoState.main |
( |
String [] |
args | ) |
|
|
static |
We first create a cumulative processor and a simple GroupProcessor
Definition at line 35 of file DuplicateNoState.java.
38 Cumulate sum1 =
new Cumulate(
39 new CumulativeFunction<Number>(Numbers.addition));
40 Connector.connect(sum1,
new Print()
41 .setPrefix(
"sum1: ").setSeparator(
"\n"));
44 Pushable p_sum1 = sum1.getPushableInput();
45 p_sum1.push(3).push(1).push(4);
49 Cumulate sum2 = (Cumulate) sum1.duplicate();
50 Connector.connect(sum2,
new Print()
51 .setPrefix(
"sum2: ").setSeparator(
"\n"));
52 Pushable p_sum2 = sum2.getPushableInput();
53 p_sum2.push(2).push(7).push(1);
The documentation for this class was generated from the following file: