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.azrael.Printable
,ca.uqac.lif.azrael.Readable
,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, ifp1
andp2
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
Fields Modifier and Type Field Description protected java.lang.String[]
m_attributeNames
The names given to the attributes corresponding to each scalarprotected FixedTupleBuilder
m_builder
-
Constructor Summary
Constructors Constructor Description MergeScalars(java.lang.String... names)
MergeScalars(java.util.List<java.lang.String> names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ca.uqac.lif.cep.functions.Function
duplicate(boolean with_state)
void
evaluate(java.lang.Object[] inputs, java.lang.Object[] outputs)
void
evaluate(java.lang.Object[] inputs, java.lang.Object[] outputs, ca.uqac.lif.cep.Context context, ca.uqac.lif.cep.EventTracker tracker)
int
getInputArity()
void
getInputTypesFor(java.util.Set<java.lang.Class<?>> classes, int index)
int
getOutputArity()
java.lang.Class<?>
getOutputTypeFor(int index)
void
reset()
-
-
-
Field Detail
-
m_attributeNames
protected final java.lang.String[] m_attributeNames
The names given to the attributes corresponding to each scalar
-
m_builder
protected FixedTupleBuilder m_builder
-
-
Method Detail
-
evaluate
public void evaluate(java.lang.Object[] inputs, java.lang.Object[] outputs, ca.uqac.lif.cep.Context context, ca.uqac.lif.cep.EventTracker tracker)
- Specified by:
evaluate
in classca.uqac.lif.cep.functions.Function
-
evaluate
public void evaluate(java.lang.Object[] inputs, java.lang.Object[] outputs)
- Overrides:
evaluate
in classca.uqac.lif.cep.functions.Function
-
getInputArity
public int getInputArity()
- Specified by:
getInputArity
in classca.uqac.lif.cep.functions.Function
-
getOutputArity
public int getOutputArity()
- Specified by:
getOutputArity
in classca.uqac.lif.cep.functions.Function
-
reset
public void reset()
- Overrides:
reset
in classca.uqac.lif.cep.functions.Function
-
duplicate
public ca.uqac.lif.cep.functions.Function duplicate(boolean with_state)
- Specified by:
duplicate
in interfaceca.uqac.lif.cep.Duplicable
- Specified by:
duplicate
in classca.uqac.lif.cep.functions.Function
-
getInputTypesFor
public void getInputTypesFor(java.util.Set<java.lang.Class<?>> classes, int index)
- Specified by:
getInputTypesFor
in classca.uqac.lif.cep.functions.Function
-
getOutputTypeFor
public java.lang.Class<?> getOutputTypeFor(int index)
- Specified by:
getOutputTypeFor
in classca.uqac.lif.cep.functions.Function
-
-