Package ca.uqac.lif.cep.tuples
Class MergeScalars
java.lang.Object
ca.uqac.lif.cep.functions.Function
ca.uqac.lif.cep.tuples.MergeScalars
- All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable,ca.uqac.lif.cep.functions.DuplicableFunction
public class MergeScalars
extends ca.uqac.lif.cep.functions.Function
Creates a named tuple out of multiple input traces, each containing scalar
values. For example, if
p1 and p2 are two processors that
return numbers, one can create a trace of tuples with attributes "foo" and
"bar", where foo is the value of the event in p1 and bar is the value of the
event in p2, by writing:
FunctionProcessor fp = new FunctionProcessor(new MergeScalars("foo", "bar"));
Connector.connect(p1, 0, fp, 0);
Connector.connect(p2, 0, fp, 1);
- Author:
- Sylvain Hallé
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String[]The names given to the attributes corresponding to each scalarprotected FixedTupleBuilderFields inherited from class ca.uqac.lif.cep.functions.Function
s_maxInputArity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionca.uqac.lif.cep.functions.Functionduplicate(boolean with_state) voidvoidintvoidgetInputTypesFor(Set<Class<?>> classes, int index) intClass<?> getOutputTypeFor(int index) voidreset()Methods inherited from class ca.uqac.lif.cep.functions.Function
duplicate, evaluate, evaluateLazy, evaluatePartial, printState, readState
-
Field Details
-
m_attributeNames
The names given to the attributes corresponding to each scalar -
m_builder
-
-
Constructor Details
-
MergeScalars
-
MergeScalars
-
-
Method Details
-
evaluate
- Specified by:
evaluatein classca.uqac.lif.cep.functions.Function
-
evaluate
- Overrides:
evaluatein classca.uqac.lif.cep.functions.Function
-
getInputArity
public int getInputArity()- Specified by:
getInputArityin classca.uqac.lif.cep.functions.Function
-
getOutputArity
public int getOutputArity()- Specified by:
getOutputArityin classca.uqac.lif.cep.functions.Function
-
reset
public void reset()- Overrides:
resetin classca.uqac.lif.cep.functions.Function
-
duplicate
public ca.uqac.lif.cep.functions.Function duplicate(boolean with_state) - Specified by:
duplicatein interfaceca.uqac.lif.cep.Duplicable- Specified by:
duplicatein classca.uqac.lif.cep.functions.Function
-
getInputTypesFor
- Specified by:
getInputTypesForin classca.uqac.lif.cep.functions.Function
-
getOutputTypeFor
- Specified by:
getOutputTypeForin classca.uqac.lif.cep.functions.Function
-