Package ca.uqac.lif.cep.tuples
Class MergeTuples
- java.lang.Object
-
- ca.uqac.lif.cep.functions.Function
-
- ca.uqac.lif.cep.tuples.MergeTuples
-
- 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 MergeTuples extends ca.uqac.lif.cep.functions.Function
Merges the key-value pairs of multiple tuples into a single tuple. If two tuples have the same key, the value in the resulting tuple is that of one of these tuples; which one is left undefined. However, if the tuples have the same value for their common keys, the resuting tuple is equivalent to that of a relational JOIN operation.- Author:
- Sylvain Hallé
-
-
Field Summary
Fields Modifier and Type Field Description protected FixedTupleBuilder
m_builder
A helper class to build instances of the merged tuplesprotected int
m_inputArity
The number of input tuples to merge
-
Constructor Summary
Constructors Constructor Description MergeTuples()
MergeTuples(int arity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MergeTuples
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_inputArity
protected int m_inputArity
The number of input tuples to merge
-
m_builder
protected FixedTupleBuilder m_builder
A helper class to build instances of the merged tuples
-
-
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 MergeTuples 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
-
-