20 import static ca.uqac.lif.cep.Connector.TOP;
21 import static ca.uqac.lif.cep.Connector.OUTPUT;
22 import static ca.uqac.lif.cep.Connector.BOTTOM;
23 import static ca.uqac.lif.cep.Connector.connect;
24 import ca.uqac.lif.cep.Pullable;
25 import ca.uqac.lif.cep.tmf.Filter;
26 import ca.uqac.lif.cep.tmf.QueueSource;
39 public static void main(String[] args)
42 QueueSource source_values =
new QueueSource();
43 source_values.setEvents(6, 5, 3, 8, 9, 2, 1, 7, 4);
45 QueueSource source_bool =
new QueueSource();
46 source_bool.setEvents(
true,
false,
true,
true,
47 false,
false,
true,
false,
true);
49 Filter filter =
new Filter();
51 connect(source_values, OUTPUT, filter, TOP);
52 connect(source_bool, OUTPUT, filter, BOTTOM);
54 Pullable p = filter.getPullableOutput();
56 for (
int i = 0; i < 5; i++)
58 int x = (Integer) p.pull();
59 System.out.printf(
"Output event #%d is %d\n", i, x);
Discard events from an input trace with the Filter processor.
static void main(String[] args)