0.10.8-alpha
ca.uqac.lif.cep.functions.IdentityFunction Class Reference

Function that returns its input for its output. More...

Public Member Functions

 IdentityFunction (int arity)
 Creates a new identity function. More...
 
void evaluate (Object[] inputs, Object[] outputs, Context context, EventTracker tracker)
 
void evaluate (Object[] inputs, Object[] outputs)
 
int getInputArity ()
 
int getOutputArity ()
 
void reset ()
 
IdentityFunction duplicate (boolean with_state)
 Duplicates an object. More...
 
void getInputTypesFor (Set< Class<?>> classes, int index)
 
Class<?> getOutputTypeFor (int index)
 
Object printState ()
 
IdentityFunction 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

int m_inArity = 1
 The input arity of the function (which is also its output arity) 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 that returns its input for its output.

It is illustrated graphically as follows:

IdentityFunction
Author
Sylvain Hallé
Since
0.3

Definition at line 34 of file IdentityFunction.java.

Constructor & Destructor Documentation

◆ IdentityFunction()

ca.uqac.lif.cep.functions.IdentityFunction.IdentityFunction ( int  arity)

Creates a new identity function.

Parameters
arityThe arity of the function

Definition at line 47 of file IdentityFunction.java.

Member Function Documentation

◆ duplicate()

IdentityFunction ca.uqac.lif.cep.functions.IdentityFunction.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 91 of file IdentityFunction.java.

◆ evaluate() [1/2]

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

Definition at line 54 of file IdentityFunction.java.

◆ evaluate() [2/2]

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

Definition at line 67 of file IdentityFunction.java.

◆ getInputArity()

int ca.uqac.lif.cep.functions.IdentityFunction.getInputArity ( )

Definition at line 73 of file IdentityFunction.java.

◆ getInputTypesFor()

void ca.uqac.lif.cep.functions.IdentityFunction.getInputTypesFor ( Set< Class<?>>  classes,
int  index 
)

Definition at line 97 of file IdentityFunction.java.

◆ getOutputArity()

int ca.uqac.lif.cep.functions.IdentityFunction.getOutputArity ( )

Definition at line 79 of file IdentityFunction.java.

◆ getOutputTypeFor()

Class<?> ca.uqac.lif.cep.functions.IdentityFunction.getOutputTypeFor ( int  index)

Definition at line 103 of file IdentityFunction.java.

◆ printState()

Object ca.uqac.lif.cep.functions.IdentityFunction.printState ( )
Since
0.10.2

Definition at line 112 of file IdentityFunction.java.

◆ readState()

IdentityFunction ca.uqac.lif.cep.functions.IdentityFunction.readState ( Object  o)
Since
0.10.2

Definition at line 121 of file IdentityFunction.java.

◆ reset()

void ca.uqac.lif.cep.functions.IdentityFunction.reset ( )

Definition at line 85 of file IdentityFunction.java.

Member Data Documentation

◆ m_inArity

int ca.uqac.lif.cep.functions.IdentityFunction.m_inArity = 1
protected

The input arity of the function (which is also its output arity)

Definition at line 39 of file IdentityFunction.java.


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