20 import ca.uqac.lif.cep.Adder;
21 import ca.uqac.lif.cep.Connector;
22 import ca.uqac.lif.cep.Pullable;
23 import ca.uqac.lif.cep.tmf.QueueSource;
38 public static void main (String[] args)
41 QueueSource source1 =
new QueueSource();
42 source1.setEvents(2, 7, 1, 8, 3);
43 QueueSource source2 =
new QueueSource();
44 source2.setEvents(3, 1, 4, 1, 6);
45 Adder add =
new Adder();
46 Connector.connect(source1, 0, add, 0);
47 Connector.connect(source2, 0, add, 1);
48 Pullable p = add.getPullableOutput();
49 for (
int i = 0; i < 5; i++)
51 float x = (Float) p.pull();
52 System.out.println(
"The event is: " + x);
Pipe processors together using the Connector object.