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

Use the CountDecimate processor to discard events from a stream. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Use the CountDecimate processor to discard events from a stream.

Graphically, this can be represented as follows:

The expected output of this program is:

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

Definition at line 38 of file CountDecimateSimple.java.

Member Function Documentation

◆ main()

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

We create a CountDecimate processor and instruct it to keep one

Definition at line 40 of file CountDecimateSimple.java.

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

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