20 import ca.uqac.lif.cep.Connector;
21 import ca.uqac.lif.cep.Pullable;
22 import ca.uqac.lif.cep.functions.ApplyFunction;
23 import ca.uqac.lif.cep.tmf.QueueSource;
24 import ca.uqac.lif.cep.util.Booleans;
51 public static void main (String[] args)
54 QueueSource source =
new QueueSource();
55 source.setEvents(
false,
true,
true,
false,
true);
56 ApplyFunction not =
new ApplyFunction(Booleans.not);
57 Connector.connect(source, not);
58 Pullable p = not.getPullableOutput();
59 for (
int i = 0; i < 5; i++)
61 boolean x = (Boolean) p.pull();
62 System.out.println(
"The event is: " + x);
Use the FunctionProcessor to apply a function to each input event.