![]() |
0.10.8-alpha
|
A Function object representing the composition of multiple functions together to form a "compound" function. More...
Public Member Functions | |
| FunctionTree (Function f) | |
| Creates a new function tree. More... | |
| FunctionTree (Function ... functions) | |
| Creates a new function tree, by specifying the root and its immediate children. More... | |
| FunctionTree | setChild (int index, Function f) |
| Sets the i-th child of the tree. More... | |
| void | evaluate (Object[] inputs, Object[] outputs, Context context, EventTracker tracker) |
| void | evaluate (Object[] inputs, Object[] outputs) |
| boolean | evaluatePartial (Object[] inputs, Object[] outputs, Context context) |
| boolean | evaluateLazy (Object[] inputs, Object[] outputs) |
| int | getInputArity () |
| int | getOutputArity () |
| void | reset () |
| synchronized FunctionTree | duplicate (boolean with_state) |
| Duplicates an object. More... | |
| void | getInputTypesFor (Set< Class<?>> classes, int index) |
| Class<?> | getOutputTypeFor (int index) |
| String | toString () |
| Object | printState () |
| FunctionTree | readState (Object o) |
Public Member Functions inherited from ca.uqac.lif.cep.functions.Function | |
| void | evaluate (Object[] inputs, Object[] outputs, Context context) |
| Evaluates the outputs of the function, given some inputs. More... | |
| abstract void | evaluate (Object[] inputs, Object[] outputs, Context context, EventTracker tracker) |
| Evaluates the outputs of the function, given some inputs. More... | |
| void | evaluate (Object[] inputs, Object[] outputs) |
| Evaluates the outputs of the function, given some inputs. More... | |
| boolean | evaluatePartial (Object[] inputs, Object[] outputs, Context context) |
| Evaluates the outputs of the function, given some inputs. More... | |
| boolean | evaluateLazy (Object[] inputs, Object[] outputs) |
| Attempts a lazy evaluation of the function, given some inputs. More... | |
| abstract int | getInputArity () |
| Gets the function's input arity, i.e. More... | |
| abstract int | getOutputArity () |
| Gets the function's output arity, i.e. More... | |
| void | reset () |
| Resets the function to its initial state. More... | |
| abstract void | getInputTypesFor (Set< Class<?>> classes, int index) |
| Populates the set of classes accepted by the function for its i-th input. More... | |
| abstract Class<?> | getOutputTypeFor (int index) |
| Returns the type of the events produced by the function for its i-th output. More... | |
| Future< Object[]> | evaluateFast (Object[] inputs, Object[] outputs, Context context, ExecutorService service) |
| Utility method that delegates the call to evaluate() More... | |
| final Function | duplicate () |
| Duplicates an object and sets it to its initial state. More... | |
| abstract Function | duplicate (boolean with_state) |
| Duplicates an object. More... | |
| Object | print (ObjectPrinter<?> printer) |
| final Function | read (ObjectReader<?> reader, Object o) throws FunctionException |
| Reads the content of a function from a serialized object. More... | |
Protected Attributes | |
| Function | m_function |
| The function to evaluate. More... | |
| Function [] | m_children |
| The children function to evaluate first. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from ca.uqac.lif.cep.functions.Function | |
| static final int | s_maxInputArity = 10 |
| The maximum input arity that a function can have. More... | |
Protected Member Functions inherited from ca.uqac.lif.cep.functions.Function | |
| Object | printState () |
| Produces an object that represents the state of the current function. More... | |
| Function | readState (Object o) |
| Reads the state of a function and uses it to create a new instance. More... | |
A Function object representing the composition of multiple functions together to form a "compound" function.
A function tree has a root, which consists of an m:m function. This function is connected to n children, which can be functions or function trees themselves. The drawing below depicts a function tree that composes multiplication and addition to form a more complex function of two arguments.
Definition at line 43 of file FunctionTree.java.
| ca.uqac.lif.cep.functions.FunctionTree.FunctionTree | ( | Function | f | ) |
Creates a new function tree.
| f | The function to act as the root of the tree |
Definition at line 61 of file FunctionTree.java.
| ca.uqac.lif.cep.functions.FunctionTree.FunctionTree | ( | Function ... | functions | ) |
Creates a new function tree, by specifying the root and its immediate children.
| functions | An array of functions. The first element of the array is the function to act as the root of the tree. The size of the array must be n+1, where n is the input arity of that function. The remaining elements of the array are the functions that will be the children of the root in the resulting tree. |
Definition at line 79 of file FunctionTree.java.
| synchronized FunctionTree ca.uqac.lif.cep.functions.FunctionTree.duplicate | ( | boolean | with_state | ) |
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.
Definition at line 185 of file FunctionTree.java.
| void ca.uqac.lif.cep.functions.FunctionTree.evaluate | ( | Object [] | inputs, |
| Object [] | outputs, | ||
| Context | context, | ||
| EventTracker | tracker | ||
| ) |
Definition at line 106 of file FunctionTree.java.
| void ca.uqac.lif.cep.functions.FunctionTree.evaluate | ( | Object [] | inputs, |
| Object [] | outputs | ||
| ) |
Definition at line 119 of file FunctionTree.java.
| boolean ca.uqac.lif.cep.functions.FunctionTree.evaluateLazy | ( | Object [] | inputs, |
| Object [] | outputs | ||
| ) |
Definition at line 144 of file FunctionTree.java.
| boolean ca.uqac.lif.cep.functions.FunctionTree.evaluatePartial | ( | Object [] | inputs, |
| Object [] | outputs, | ||
| Context | context | ||
| ) |
Definition at line 125 of file FunctionTree.java.
| int ca.uqac.lif.cep.functions.FunctionTree.getInputArity | ( | ) |
Definition at line 150 of file FunctionTree.java.
| void ca.uqac.lif.cep.functions.FunctionTree.getInputTypesFor | ( | Set< Class<?>> | classes, |
| int | index | ||
| ) |
Definition at line 196 of file FunctionTree.java.
| int ca.uqac.lif.cep.functions.FunctionTree.getOutputArity | ( | ) |
Definition at line 168 of file FunctionTree.java.
| Class<?> ca.uqac.lif.cep.functions.FunctionTree.getOutputTypeFor | ( | int | index | ) |
Definition at line 212 of file FunctionTree.java.
| Object ca.uqac.lif.cep.functions.FunctionTree.printState | ( | ) |
Definition at line 246 of file FunctionTree.java.
| FunctionTree ca.uqac.lif.cep.functions.FunctionTree.readState | ( | Object | o | ) |
Definition at line 261 of file FunctionTree.java.
| void ca.uqac.lif.cep.functions.FunctionTree.reset | ( | ) |
Definition at line 174 of file FunctionTree.java.
| FunctionTree ca.uqac.lif.cep.functions.FunctionTree.setChild | ( | int | index, |
| Function | f | ||
| ) |
Sets the i-th child of the tree.
| index | The index. The method does not check ranges, so an ArrayIndexOutOfBounds exception will be thrown if attempting to set a child in an invalid position. |
| f | The function |
Definition at line 99 of file FunctionTree.java.
| String ca.uqac.lif.cep.functions.FunctionTree.toString | ( | ) |
Definition at line 218 of file FunctionTree.java.
|
protected |
The children function to evaluate first.
Definition at line 53 of file FunctionTree.java.
|
protected |
The function to evaluate.
Definition at line 48 of file FunctionTree.java.