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

Representation of a unary constant. More...

Public Member Functions

 Constant (Object value)
 Creates a new constant. 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)
 
int getInputArity ()
 
int getOutputArity ()
 
void reset ()
 
Constant duplicate (boolean with_state)
 Duplicates an object. More...
 
void getInputTypesFor (Set< Class<?>> classes, int index)
 
Class<?> getOutputTypeFor (int index)
 
String toString ()
 
Object getValue ()
 Gets the actual object that this constant processor returns. More...
 
Object printState ()
 
Constant 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...
 

Static Public Attributes

static final transient Constant ZERO = new Constant(0)
 A constant representing the number zero. More...
 
static final transient Constant ONE = new Constant(1)
 A constant representing the number one. More...
 
- 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...
 

Additional Inherited Members

- 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

Representation of a unary constant.

Author
Sylvain Hallé
Since
0.3

Definition at line 30 of file Constant.java.

Constructor & Destructor Documentation

◆ Constant()

ca.uqac.lif.cep.functions.Constant.Constant ( Object  value)

Creates a new constant.

Parameters
valueThe value associated to this constant

Definition at line 53 of file Constant.java.

Member Function Documentation

◆ duplicate()

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

◆ evaluate() [1/2]

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

Definition at line 60 of file Constant.java.

◆ evaluate() [2/2]

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

Definition at line 70 of file Constant.java.

◆ evaluatePartial()

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

Definition at line 76 of file Constant.java.

◆ getInputArity()

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

Definition at line 83 of file Constant.java.

◆ getInputTypesFor()

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

Definition at line 107 of file Constant.java.

◆ getOutputArity()

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

Definition at line 89 of file Constant.java.

◆ getOutputTypeFor()

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

Definition at line 114 of file Constant.java.

◆ getValue()

Object ca.uqac.lif.cep.functions.Constant.getValue ( )

Gets the actual object that this constant processor returns.

Returns
The value

Definition at line 134 of file Constant.java.

◆ printState()

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

Definition at line 143 of file Constant.java.

◆ readState()

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

Definition at line 152 of file Constant.java.

◆ reset()

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

Definition at line 95 of file Constant.java.

◆ toString()

String ca.uqac.lif.cep.functions.Constant.toString ( )

Definition at line 120 of file Constant.java.

Member Data Documentation

◆ ONE

final transient Constant ca.uqac.lif.cep.functions.Constant.ONE = new Constant(1)
static

A constant representing the number one.

Definition at line 40 of file Constant.java.

◆ ZERO

final transient Constant ca.uqac.lif.cep.functions.Constant.ZERO = new Constant(0)
static

A constant representing the number zero.

Definition at line 35 of file Constant.java.


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