Class SerializeEvents<T>

java.lang.Object
ca.uqac.lif.cep.functions.Function
ca.uqac.lif.cep.serialization.SerializeEvents<T>
Type Parameters:
T - The type of the serialized objects
All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable, ca.uqac.lif.cep.functions.DuplicableFunction
Direct Known Subclasses:
JsonSerialize, JsonSerializeString

public class SerializeEvents<T> extends ca.uqac.lif.cep.functions.Function
Function that applies a serializer to its input argument. An ApplyFunction that applies a serialization function will be depicted graphically by this pictogram:

Processor graph

The picture represents an event that is "packed" into a box with a barcode, representing its serialized form.

Author:
Sylvain Hallé
  • Field Details

    • m_serializer

      protected transient ca.uqac.lif.azrael.ObjectPrinter<T> m_serializer
      The serializer
    • m_outputType

      protected final transient Class<T> m_outputType
      A reference to the class of the serialized objects. This is used in getOutputTypeFor(int) to return the output type for this processor.
  • Constructor Details

    • SerializeEvents

      public SerializeEvents(ca.uqac.lif.azrael.ObjectPrinter<T> s, Class<T> output_type)
      Creates a new instance of the function.
      Parameters:
      s - The serializer used to serialize the function's arguments
      output_type - A reference to the class of the serialized objects
  • Method Details

    • evaluate

      public void evaluate(Object[] inputs, Object[] outputs, ca.uqac.lif.cep.Context context)
      Specified by:
      evaluate in class ca.uqac.lif.cep.functions.Function
    • getInputArity

      public int getInputArity()
      Specified by:
      getInputArity in class ca.uqac.lif.cep.functions.Function
    • getOutputArity

      public int getOutputArity()
      Specified by:
      getOutputArity in class ca.uqac.lif.cep.functions.Function
    • reset

      public void reset()
      Overrides:
      reset in class ca.uqac.lif.cep.functions.Function
    • duplicate

      public SerializeEvents<T> duplicate(boolean with_state)
      Specified by:
      duplicate in interface ca.uqac.lif.cep.Duplicable
      Specified by:
      duplicate in class ca.uqac.lif.cep.functions.Function
    • getInputTypesFor

      public void getInputTypesFor(Set<Class<?>> classes, int index)
      Specified by:
      getInputTypesFor in class ca.uqac.lif.cep.functions.Function
    • getOutputTypeFor

      public Class<?> getOutputTypeFor(int index)
      Specified by:
      getOutputTypeFor in class ca.uqac.lif.cep.functions.Function