![]() |
0.11.4
|
Public Member Functions | |
| void | evaluate (Object[] inputs, Object[] outputs, Context context) |
| Evaluates the outputs of the function, given some inputs. | |
| abstract void | evaluate (Object[] inputs, Object[] outputs, Context context, EventTracker tracker) |
| Evaluates the outputs of the function, given some inputs. | |
| void | evaluate (Object[] inputs, Object[] outputs) |
| Evaluates the outputs of the function, given some inputs. | |
| boolean | evaluatePartial (Object[] inputs, Object[] outputs, Context context) |
| Evaluates the outputs of the function, given some inputs. | |
| boolean | evaluateLazy (Object[] inputs, Object[] outputs) |
| Attempts a lazy evaluation of the function, given some inputs. | |
| abstract int | getInputArity () |
| Gets the function's input arity, i.e. | |
| abstract int | getOutputArity () |
| Gets the function's output arity, i.e. | |
| void | reset () |
| Resets the function to its initial state. | |
| abstract void | getInputTypesFor (Set< Class<?> > classes, int index) |
| Populates the set of classes accepted by the function for its i-th input. | |
| abstract Class<?> | getOutputTypeFor (int index) |
| Returns the type of the events produced by the function for its i-th output. | |
| final Function | duplicate () |
| Duplicates an object and sets it to its initial state. | |
| abstract Function | duplicate (boolean with_state) |
| Duplicates an object. | |
| Object | print (ObjectPrinter<?> printer) |
| final Function | read (ObjectReader<?> reader, Object o) throws FunctionException |
| Reads the content of a function from a serialized object. | |
Static Public Attributes | |
| static final int | s_maxInputArity = 10 |
| The maximum input arity that a function can have. | |
Protected Member Functions | |
| Object | printState () |
| Produces an object that represents the state of the current function. | |
| Function | readState (Object o) |
| Reads the state of a function and uses it to create a new instance. | |
| final Function ca.uqac.lif.cep.functions.Function.duplicate | ( | ) |
Duplicates an object and sets it to its initial state.
This should be the same thing as calling duplicate(false).
Implements ca.uqac.lif.cep.functions.DuplicableFunction.
Definition at line 205 of file Function.java.
|
abstract |
Duplicates an object.
Optionally, set the object into the same state as the source object.
| with_state | Set to true to replicate the object's state, false to create a new copy in the initial state. |
Implements ca.uqac.lif.cep.Duplicable.
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunctionArgument, ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.ContextVariable, ca.uqac.lif.cep.functions.FunctionLambda, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.StreamVariable, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.util.Bags.Explode, ca.uqac.lif.cep.util.Bags.ToArray, ca.uqac.lif.cep.util.Bags.ToList, ca.uqac.lif.cep.util.Bags.ToSet, ca.uqac.lif.cep.util.InstanceOf, ca.uqac.lif.cep.util.Maps.FilterMap, ca.uqac.lif.cep.util.Multiset.GetCardinalities, ca.uqac.lif.cep.util.Multiset.Insert, ca.uqac.lif.cep.util.NthElement, and ca.uqac.lif.cep.util.Numbers.NumberCast.
| void ca.uqac.lif.cep.functions.Function.evaluate | ( | Object[] | inputs, |
| Object[] | outputs ) |
Evaluates the outputs of the function, given some inputs.
| inputs | The arguments of the function. The size of the array should be equal to the function's declared input arity. |
| outputs | The outputs of the function. The size of the array should be equal to the function's declared output arity. @ Any exception that may occur during the evaluation of a function |
Reimplemented in ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, and ca.uqac.lif.cep.functions.Variable.
Definition at line 99 of file Function.java.
| void ca.uqac.lif.cep.functions.Function.evaluate | ( | Object[] | inputs, |
| Object[] | outputs, | ||
| Context | context ) |
Evaluates the outputs of the function, given some inputs.
| inputs | The arguments of the function. The size of the array should be equal to the function's declared input arity. |
| outputs | The outputs of the function. The size of the array should be equal to the function's declared output arity. |
| context | The context in which the evaluation is done. If the function's arguments contains placeholders, they will be replaced by the corresponding object fetched from this map before evaluating the function |
Definition at line 60 of file Function.java.
|
abstract |
Evaluates the outputs of the function, given some inputs.
| inputs | The arguments of the function. The size of the array should be equal to the function's declared input arity. |
| outputs | The outputs of the function. The size of the array should be equal to the function's declared output arity. |
| context | The context in which the evaluation is done. If the function's arguments contains placeholders, they will be replaced by the corresponding object fetched from this map before evaluating the function |
| tracker | An event tracker to record associations between inputs and outputs. This argument is optional and may be null. |
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunctionArgument, ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.ContextVariable, ca.uqac.lif.cep.functions.FunctionLambda, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.StreamVariable, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.util.Bags.Explode, ca.uqac.lif.cep.util.Bags.ToArray, ca.uqac.lif.cep.util.Bags.ToList, and ca.uqac.lif.cep.util.Bags.ToSet.
| boolean ca.uqac.lif.cep.functions.Function.evaluateLazy | ( | Object[] | inputs, |
| Object[] | outputs ) |
Attempts a lazy evaluation of the function, given some inputs.
| inputs | The arguments of the function. The size of the array should be equal to the function's declared input arity. |
| outputs | The outputs of the function. The size of the array should be equal to the function's declared output arity. @ Any exception that may occur during the evaluation of a function |
true if the function succeeded in producing an output value, false otherwise Reimplemented in ca.uqac.lif.cep.functions.FunctionTree.
Definition at line 150 of file Function.java.
| boolean ca.uqac.lif.cep.functions.Function.evaluatePartial | ( | Object[] | inputs, |
| Object[] | outputs, | ||
| Context | context ) |
Evaluates the outputs of the function, given some inputs.
| inputs | The arguments of the function. The size of the array should be equal to the function's declared input arity. |
| outputs | The outputs of the function. The size of the array should be equal to the function's declared output arity. |
| context | The context in which the evaluation is done. If the function's arguments contains placeholders, they will be replaced by the corresponding object fetched from this map before evaluating the function |
true if the function succeeded in producing an output value, false otherwise Reimplemented in ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.StreamVariable, ca.uqac.lif.cep.util.Booleans.And, ca.uqac.lif.cep.util.Booleans.Implies, ca.uqac.lif.cep.util.Booleans.Or, and ca.uqac.lif.cep.util.Numbers.Multiplication.
Definition at line 122 of file Function.java.
|
abstract |
Gets the function's input arity, i.e.
the number of arguments it takes.
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunctionArgument, ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionLambda, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.functions.Variable, ca.uqac.lif.cep.util.Bags.Explode, and ca.uqac.lif.cep.util.Bags.ToCollection.
|
abstract |
Populates the set of classes accepted by the function for its i-th input.
| classes | The set of to fill with classes |
| index | The index of the input to query |
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunctionArgument, ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionLambda, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.functions.Variable, ca.uqac.lif.cep.util.Bags.Explode, and ca.uqac.lif.cep.util.Bags.ToCollection.
|
abstract |
Gets the function's output arity, i.e.
the number of elements it outputs. (We expect that most functions will have an output arity of 1.)
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunctionArgument, ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionLambda, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.functions.Variable, ca.uqac.lif.cep.util.Bags.Explode, and ca.uqac.lif.cep.util.Bags.ToCollection.
|
abstract |
Returns the type of the events produced by the function for its i-th output.
| index | The index of the output to query |
Reimplemented in ca.uqac.lif.cep.functions.ApplyFunctionArgument, ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionLambda, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.functions.Variable, ca.uqac.lif.cep.util.Bags.Explode, ca.uqac.lif.cep.util.Bags.ToArray, ca.uqac.lif.cep.util.Bags.ToList, and ca.uqac.lif.cep.util.Bags.ToSet.
| Object ca.uqac.lif.cep.functions.Function.print | ( | ObjectPrinter<?> | printer | ) |
Definition at line 217 of file Function.java.
|
protected |
Produces an object that represents the state of the current function.
A concrete function should override this method to add whatever state information that needs to be preserved in the serialization process.
null) Reimplemented in ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.ContextVariable, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.StreamVariable, and ca.uqac.lif.cep.util.NthElement.
Definition at line 239 of file Function.java.
| final Function ca.uqac.lif.cep.functions.Function.read | ( | ObjectReader<?> | reader, |
| Object | o ) throws FunctionException |
Reads the content of a function from a serialized object.
| reader | An object reader |
| o | The object to read from |
| FunctionException | If the read operation failed for some reason |
Definition at line 253 of file Function.java.
|
protected |
Reads the state of a function and uses it to create a new instance.
| o | The object containing the function's state |
Reimplemented in ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.ContextVariable, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.RaiseArity, ca.uqac.lif.cep.functions.StreamVariable, and ca.uqac.lif.cep.util.NthElement.
Definition at line 290 of file Function.java.
| void ca.uqac.lif.cep.functions.Function.reset | ( | ) |
Resets the function to its initial state.
In the case of a stateless function, nothing requires to be done.
Reimplemented in ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >, ca.uqac.lif.cep.functions.Constant, ca.uqac.lif.cep.functions.FunctionTree, ca.uqac.lif.cep.functions.IdentityFunction, ca.uqac.lif.cep.functions.IfThenElse, ca.uqac.lif.cep.functions.PassthroughFunction, ca.uqac.lif.cep.functions.UnaryFunction< T, U >, ca.uqac.lif.cep.functions.Variable, and ca.uqac.lif.cep.util.Bags.ToCollection.
Definition at line 177 of file Function.java.
|
static |
The maximum input arity that a function can have.
Definition at line 43 of file Function.java.