Class DeserializeEvents<T,​U>

  • Type Parameters:
    T - The type of the deserialized objects
    All Implemented Interfaces:
    ca.uqac.lif.azrael.Printable, ca.uqac.lif.azrael.Readable, ca.uqac.lif.cep.Duplicable, ca.uqac.lif.cep.functions.DuplicableFunction
    Direct Known Subclasses:
    JsonDeserialize, JsonDeserializeString

    public class DeserializeEvents<T,​U>
    extends ca.uqac.lif.cep.functions.Function
    Function that applies a deserializer to its input argument. A FunctionProcessor that applies a serialization function will be depicted graphically by this pictogram:

    Processor graph

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

    Author:
    Sylvain Hallé
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Class<T> m_inputType
      A reference to the class of the serialized objects.
      protected java.lang.Class<U> m_outputType
      A reference to the class of the serialized objects.
      protected ca.uqac.lif.azrael.ObjectReader<T> m_serializer
      The serializer
      • Fields inherited from class ca.uqac.lif.cep.functions.Function

        s_maxInputArity
    • Constructor Summary

      Constructors 
      Constructor Description
      DeserializeEvents​(ca.uqac.lif.azrael.ObjectReader<T> s, java.lang.Class<T> input_type, java.lang.Class<U> output_type)
      Creates a new instance of the function.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DeserializeEvents<T,​U> 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()  
      • Methods inherited from class ca.uqac.lif.cep.functions.Function

        duplicate, evaluate, evaluateLazy, evaluatePartial, print, printState, read, readState
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_serializer

        protected transient ca.uqac.lif.azrael.ObjectReader<T> m_serializer
        The serializer
      • m_inputType

        protected final transient java.lang.Class<T> m_inputType
        A reference to the class of the serialized objects. This is used in getInputTypesFor(Set, int) to define the input type for this processor.
      • m_outputType

        protected final transient java.lang.Class<U> 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 Detail

      • DeserializeEvents

        public DeserializeEvents​(ca.uqac.lif.azrael.ObjectReader<T> s,
                                 java.lang.Class<T> input_type,
                                 java.lang.Class<U> output_type)
        Creates a new instance of the function.
        Parameters:
        s - The object reader used to deserialize the function's arguments
        input_type - A reference to the class of the serialized objects given as an argument
        output_type - A reference to the class of the deserialized objects
    • 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 class ca.uqac.lif.cep.functions.Function
      • evaluate

        public void evaluate​(java.lang.Object[] inputs,
                             java.lang.Object[] outputs)
        Overrides:
        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 DeserializeEvents<T,​U> 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​(java.util.Set<java.lang.Class<?>> classes,
                                     int index)
        Specified by:
        getInputTypesFor in class ca.uqac.lif.cep.functions.Function
      • getOutputTypeFor

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