20 import ca.uqac.lif.cep.Connector;
21 import ca.uqac.lif.cep.Pullable;
22 import ca.uqac.lif.cep.Pushable;
23 import ca.uqac.lif.cep.functions.ApplyFunction;
24 import ca.uqac.lif.cep.functions.Cumulate;
25 import ca.uqac.lif.cep.functions.CumulativeFunction;
26 import ca.uqac.lif.cep.tmf.Tank;
27 import ca.uqac.lif.cep.util.Numbers;
31 public static void main(String[] args)
34 ApplyFunction to_number =
new ApplyFunction(Numbers.numberCast);
35 Tank tank =
new Tank();
36 Cumulate sum =
new Cumulate(
37 new CumulativeFunction<Number>(Numbers.addition));
38 Connector.connect(to_number, tank, sum);
41 Pushable ps = to_number.getPushableInput();
42 Pullable pl = sum.getPullableOutput();
45 System.out.println(pl.pull());
46 System.out.println(pl.pull());
47 System.out.println(pl.pull());
static void main(String[] args)