Code Examples
A repository of 155 code examples for BeepBeep
basic.ResetWindow Class Reference

Usage of a processor's reset() method. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Usage of a processor's reset() method.

Author
Sylvain Hallé Easy

Definition at line 34 of file ResetWindow.java.

Member Function Documentation

◆ main()

static void basic.ResetWindow.main ( String []  args)
static

We create a window processor that will compute a sum of numbers

Definition at line 36 of file ResetWindow.java.

37  {
38  /// We create a window processor that will compute a sum of numbers
39  // over a sliding window of width 3
40  Window w = new Window(new Cumulate(
41  new CumulativeFunction<Number>(Numbers.addition)), 3);
42  Connector.connect(w, new Print());
43  Pushable p = w.getPushableInput();
44  // Let us push some events and print them
45  p.push(3).push(1).push(4).push(1).push(6);
46  // We now reset the window and push new events. Notice how the
47  // first two calls on push do not print anything.
48  w.reset();
49  p.push(2).push(7).push(1).push(8).push(3);
50  ///
51  }

The documentation for this class was generated from the following file: