0.10.8-alpha
|
Function of two inputs and one output. More...
Public Member Functions | |
BinaryFunction (Class< T > t, Class< V > v, Class< U > u) | |
Creates a new instance of a binary function. More... | |
void | evaluate (Object[] inputs, Object[] outputs, Context context, EventTracker tracker) |
abstract U | getValue (T x, V y) |
Evaluates the function. More... | |
final int | getInputArity () |
final int | getOutputArity () |
U | getStartValue () |
Gets a reasonable starting value if this function is used to create a CumulativeFunction. More... | |
void | reset () |
BinaryFunction< T, V, U > | duplicate (boolean with_state) |
Duplicates an object. More... | |
final Class< T > | getInputTypeLeft () |
final Class< V > | getInputTypeRight () |
final void | getInputTypesFor (Set< Class<?>> classes, int index) |
final Class< U > | getOutputType () |
final Class<?> | getOutputTypeFor (int index) |
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 Member Functions | |
void | trackAssociations (T x, V y, U z, EventTracker tracker) |
Tracks the input/output associations for the evaluation of this function. 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... | |
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... | |
Function of two inputs and one output.
<T> | The type of the first input |
<V> | The type of the second input |
<U> | The type of the output |
Definition at line 37 of file BinaryFunction.java.
ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.BinaryFunction | ( | Class< T > | t, |
Class< V > | v, | ||
Class< U > | u | ||
) |
Creates a new instance of a binary function.
t | The class of the first input |
v | The class of the second input |
u | The class of the output |
Definition at line 64 of file BinaryFunction.java.
BinaryFunction<T, V, U> ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.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 145 of file BinaryFunction.java.
void ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.evaluate | ( | Object [] | inputs, |
Object [] | outputs, | ||
Context | context, | ||
EventTracker | tracker | ||
) |
Definition at line 75 of file BinaryFunction.java.
final int ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getInputArity | ( | ) |
Definition at line 114 of file BinaryFunction.java.
final Class<T> ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getInputTypeLeft | ( | ) |
Definition at line 150 of file BinaryFunction.java.
final Class<V> ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getInputTypeRight | ( | ) |
Definition at line 155 of file BinaryFunction.java.
final void ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getInputTypesFor | ( | Set< Class<?>> | classes, |
int | index | ||
) |
Definition at line 161 of file BinaryFunction.java.
final int ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getOutputArity | ( | ) |
Definition at line 120 of file BinaryFunction.java.
final Class<U> ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getOutputType | ( | ) |
Definition at line 173 of file BinaryFunction.java.
final Class<?> ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getOutputTypeFor | ( | int | index | ) |
Definition at line 179 of file BinaryFunction.java.
U ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.getStartValue | ( | ) |
Gets a reasonable starting value if this function is used to create a CumulativeFunction.
You only need to override this method if the function is expected to be used in a cumulative function; otherwise returning null is fine.
Definition at line 133 of file BinaryFunction.java.
|
abstract |
Evaluates the function.
x | The first argument |
y | The second argument |
void ca.uqac.lif.cep.functions.BinaryFunction< T, V, U >.reset | ( | ) |
Definition at line 139 of file BinaryFunction.java.
|
protected |
Tracks the input/output associations for the evaluation of this function.
x | The first argument |
y | The second argument |
z | The return value of the function |
tracker | The tracker |
Definition at line 107 of file BinaryFunction.java.