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

Discard events from an input trace with the Filter processor. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Discard events from an input trace with the Filter processor.

This example can be represented grahpically as:

Processor graph
Author
Sylvain Hallé Easy

Definition at line 37 of file FilterSimple.java.

Member Function Documentation

◆ main()

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

Create a first trace of dummy values

Definition at line 39 of file FilterSimple.java.

40  {
41  /// Create a first trace of dummy values
42  QueueSource source_values = new QueueSource();
43  source_values.setEvents(6, 5, 3, 8, 9, 2, 1, 7, 4);
44  // Create a second trace of Boolean values
45  QueueSource source_bool = new QueueSource();
46  source_bool.setEvents(true, false, true, true,
47  false, false, true, false, true);
48  // Create a filter
49  Filter filter = new Filter();
50  // Connect both to the filter
51  connect(source_values, OUTPUT, filter, TOP);
52  connect(source_bool, OUTPUT, filter, BOTTOM);
53  // Get a reference to the filter's output pullable
54  Pullable p = filter.getPullableOutput();
55  // Pull 5 events from p
56  for (int i = 0; i < 5; i++)
57  {
58  int x = (Integer) p.pull();
59  System.out.printf("Output event #%d is %d\n", i, x);
60  }
61  ///
62  }

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