20 import ca.uqac.lif.cep.Connector;
21 import ca.uqac.lif.cep.Pullable;
22 import ca.uqac.lif.cep.tmf.CountDecimate;
23 import ca.uqac.lif.cep.tmf.QueueSource;
38 public static void main(String[] args)
41 QueueSource source =
new QueueSource().loop(
false);
42 source.setEvents(0, 1, 2, 3);
43 CountDecimate decim =
new CountDecimate(2);
44 Connector.connect(source, decim);
45 Pullable p = decim.getPullableOutput();
48 for (
int i = 0; i < 5; i++)
50 boolean b = p.hasNext();
51 System.out.println(b);
54 System.out.println(p.pull());
Illustration of the difference between using pull() and pullSoft() on a Pullable object.
static void main(String[] args)