0.10.8-alpha
ca.uqac.lif.cep.functions.UnaryFunction< T, U > Class Template Referenceabstract

Function of one input and one output. More...

Public Member Functions

 UnaryFunction (Class< T > t, Class< U > u)
 Creates a new instance of an unary function. More...
 
void evaluate (Object[] inputs, Object[] outputs, Context context, EventTracker tracker)
 
abstract U getValue (T x)
 Evaluates the function. More...
 
final int getInputArity ()
 
final int getOutputArity ()
 
void reset ()
 
UnaryFunction< T, U > duplicate (boolean with_state)
 Duplicates an object. More...
 
final void getInputTypesFor (Set< Class<?>> classes, int index)
 
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...
 

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

Detailed Description

Function of one input and one output.

Parameters
<T>The type of the input
<U>The type of the output
Since
0.2.1

Definition at line 34 of file UnaryFunction.java.

Constructor & Destructor Documentation

◆ UnaryFunction()

ca.uqac.lif.cep.functions.UnaryFunction< T, U >.UnaryFunction ( Class< T >  t,
Class< U >  u 
)

Creates a new instance of an unary function.

Parameters
tThe class of the input
uThe class of the output

Definition at line 54 of file UnaryFunction.java.

Member Function Documentation

◆ duplicate()

UnaryFunction<T, U> ca.uqac.lif.cep.functions.UnaryFunction< T, U >.duplicate ( boolean  with_state)

Duplicates an object.

Optionally, set the object into the same state as the source object.

Parameters
with_stateSet to true to replicate the object's state, false to create a new copy in the initial state.
Returns
Another object

Implements ca.uqac.lif.cep.Duplicable.

Definition at line 104 of file UnaryFunction.java.

◆ evaluate()

void ca.uqac.lif.cep.functions.UnaryFunction< T, U >.evaluate ( Object []  inputs,
Object []  outputs,
Context  context,
EventTracker  tracker 
)

Definition at line 64 of file UnaryFunction.java.

◆ getInputArity()

final int ca.uqac.lif.cep.functions.UnaryFunction< T, U >.getInputArity ( )

Definition at line 86 of file UnaryFunction.java.

◆ getInputTypesFor()

final void ca.uqac.lif.cep.functions.UnaryFunction< T, U >.getInputTypesFor ( Set< Class<?>>  classes,
int  index 
)

Definition at line 110 of file UnaryFunction.java.

◆ getOutputArity()

final int ca.uqac.lif.cep.functions.UnaryFunction< T, U >.getOutputArity ( )

Definition at line 92 of file UnaryFunction.java.

◆ getOutputTypeFor()

Class<?> ca.uqac.lif.cep.functions.UnaryFunction< T, U >.getOutputTypeFor ( int  index)

Definition at line 116 of file UnaryFunction.java.

◆ getValue()

abstract U ca.uqac.lif.cep.functions.UnaryFunction< T, U >.getValue ( x)
abstract

Evaluates the function.

Parameters
xThe argument
Returns
The return value of the function
Exceptions
Anyexception occurring during the evaluation of the underlying function

◆ reset()

Definition at line 98 of file UnaryFunction.java.


The documentation for this class was generated from the following file: