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

Behaviour of the CountDecimate processor on the last event of a stream. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Behaviour of the CountDecimate processor on the last event of a stream.

The expected output of this program is:

0,3,6,9,
Author
Sylvain Hallé

Definition at line 35 of file CountDecimateLast.java.

Member Function Documentation

◆ main()

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

We create a CountDecimate processor and instruct it to keep one

Definition at line 37 of file CountDecimateLast.java.

38  {
39  /// We create a CountDecimate processor and instruct it to keep one
40  // event every 3
41  CountDecimate dec = new CountDecimate(3, true);
42 
43  // We connect dec to a Print processor
44  Print print = new Print();
45  Connector.connect(dec, print);
46 
47  // We get a hold of dec's Pushable object and push the integers
48  // 0 to 9.
49  Pushable p = dec.getPushableInput();
50  for (int i = 0; i < 8; i++)
51  {
52  p.push(i);
53  }
54  p.notifyEndOfTrace();
55  ///
56  }

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