20 import ca.uqac.lif.cep.functions.StreamVariable;
21 import ca.uqac.lif.cep.functions.FunctionException;
22 import ca.uqac.lif.cep.functions.FunctionTree;
23 import ca.uqac.lif.cep.util.Booleans;
24 import ca.uqac.lif.cep.util.Numbers;
39 public static void main(String[] args)
throws FunctionException
48 FunctionTree in_interval =
new FunctionTree(Booleans.and,
49 new FunctionTree(Numbers.isGreaterThan,
52 new FunctionTree(Numbers.isLessThan,
56 Object[] value =
new Object[1];
57 in_interval.evaluate(
new Integer[]{3, 2, 8}, value);
62 System.out.printf(
"Return value of the function: %b\n", value[0]);
63 in_interval.evaluate(
new Integer[]{6, 7, 9}, value);
64 System.out.printf(
"Return value of the function: %b\n", value[0]);
Creates a compound function (a FunctionTree) that checks if a number lies between two other numbers...