0.11.4
ca.uqac.lif.cep.functions.Function Class Referenceabstract

Detailed Description

Represents a stateless m-to-n function.

Author
Sylvain Hallé
Since
0.2.1

Definition at line 38 of file Function.java.

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.

Member Function Documentation

◆ duplicate() [1/2]

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).

Returns
Another object

Implements ca.uqac.lif.cep.functions.DuplicableFunction.

Definition at line 205 of file Function.java.

◆ duplicate() [2/2]

◆ evaluate() [1/3]

void ca.uqac.lif.cep.functions.Function.evaluate ( Object[] inputs,
Object[] outputs )

Evaluates the outputs of the function, given some inputs.

Parameters
inputsThe arguments of the function. The size of the array should be equal to the function's declared input arity.
outputsThe 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.

◆ evaluate() [2/3]

void ca.uqac.lif.cep.functions.Function.evaluate ( Object[] inputs,
Object[] outputs,
Context context )

Evaluates the outputs of the function, given some inputs.

Parameters
inputsThe arguments of the function. The size of the array should be equal to the function's declared input arity.
outputsThe outputs of the function. The size of the array should be equal to the function's declared output arity.
contextThe 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.

◆ evaluate() [3/3]

abstract void ca.uqac.lif.cep.functions.Function.evaluate ( Object[] inputs,
Object[] outputs,
Context context,
EventTracker tracker )
abstract

Evaluates the outputs of the function, given some inputs.

Parameters
inputsThe arguments of the function. The size of the array should be equal to the function's declared input arity.
outputsThe outputs of the function. The size of the array should be equal to the function's declared output arity.
contextThe 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
trackerAn 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.

◆ evaluateLazy()

boolean ca.uqac.lif.cep.functions.Function.evaluateLazy ( Object[] inputs,
Object[] outputs )

Attempts a lazy evaluation of the function, given some inputs.

Parameters
inputsThe arguments of the function. The size of the array should be equal to the function's declared input arity.
outputsThe 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
Returns
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.

◆ evaluatePartial()

boolean ca.uqac.lif.cep.functions.Function.evaluatePartial ( Object[] inputs,
Object[] outputs,
Context context )

Evaluates the outputs of the function, given some inputs.

Parameters
inputsThe arguments of the function. The size of the array should be equal to the function's declared input arity.
outputsThe outputs of the function. The size of the array should be equal to the function's declared output arity.
contextThe 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
Returns
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.

◆ getInputArity()

◆ getInputTypesFor()

◆ getOutputArity()

◆ getOutputTypeFor()

◆ print()

Object ca.uqac.lif.cep.functions.Function.print ( ObjectPrinter<?> printer)
Since
0.10.2

Definition at line 217 of file Function.java.

◆ printState()

Object ca.uqac.lif.cep.functions.Function.printState ( )
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.

Returns
Any object representing the function's state (including null)
Since
0.10.2

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.

◆ read()

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.

Parameters
readerAn object reader
oThe object to read from
Returns
The deserialized function
Exceptions
FunctionExceptionIf the read operation failed for some reason

Definition at line 253 of file Function.java.

◆ readState()

Function ca.uqac.lif.cep.functions.Function.readState ( Object o)
protected

Reads the state of a function and uses it to create a new instance.

Parameters
oThe object containing the function's state
Returns
A new function instance
Since
0.10.2

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.

◆ reset()

Member Data Documentation

◆ s_maxInputArity

final int ca.uqac.lif.cep.functions.Function.s_maxInputArity = 10
static

The maximum input arity that a function can have.

Definition at line 43 of file Function.java.


The documentation for this class was generated from the following file:
  • /home/sylvain/Workspaces/beepbeep/core/src/ca/uqac/lif/cep/functions/Function.java