Use a Window processor to perform a computation over a sliding window of events.
More...
|
static void | main (String[] args) |
|
Use a Window processor to perform a computation over a sliding window of events.
The chain of processors in this example can be represented graphically as:
- Author
- Sylvain Hallé Easy
Definition at line 38 of file WindowSimple.java.
◆ main()
static void basic.WindowSimple.main |
( |
String [] |
args | ) |
|
|
static |
Create a source of arbitrary numbers
Definition at line 40 of file WindowSimple.java.
43 QueueSource source =
new QueueSource().setEvents(1, 2, 3, 4, 5, 6);
46 Cumulate sum =
new Cumulate(
47 new CumulativeFunction<Number>(Numbers.addition));
51 Window win =
new Window(sum, 3);
52 Connector.connect(source, win);
55 Pullable p = win.getPullableOutput();
56 System.out.println(
"First window: " + p.pull());
57 System.out.println(
"Second window: " + p.pull());
58 System.out.println(
"Third window: " + p.pull());
The documentation for this class was generated from the following file: