20 import ca.uqac.lif.cep.Connector;
21 import ca.uqac.lif.cep.Pullable;
22 import ca.uqac.lif.cep.tmf.QueueSource;
23 import ca.uqac.lif.cep.tmf.Trim;
38 public static void main (String[] args)
41 QueueSource source =
new QueueSource().setEvents(1, 2, 3, 4, 5, 6);
45 Trim trim =
new Trim(3);
48 Connector.connect(source, trim);
52 Pullable p = trim.getPullableOutput();
53 for (
int i = 0; i < 6; i++)
55 int x = (Integer) p.pull();
56 System.out.println(
"The event is: " + x);
Use the Trim processor to discard events from the beginning of a stream.
static void main(String[] args)