Class PredicateGet

java.lang.Object
ca.uqac.lif.cep.functions.Function
ca.uqac.lif.cep.functions.UnaryFunction<PredicateTuple,Object>
ca.uqac.lif.cep.fol.PredicateGet
All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable, ca.uqac.lif.cep.functions.DuplicableFunction

public class PredicateGet extends ca.uqac.lif.cep.functions.UnaryFunction<PredicateTuple,Object>
Extracts the value at a specific position in the predicate tuple.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The position to extract from each tuple

    Fields inherited from class ca.uqac.lif.cep.functions.Function

    s_maxInputArity
  • Constructor Summary

    Constructors
    Constructor
    Description
    PredicateGet(int position)
    Creates an instance of the function
  • Method Summary

    Modifier and Type
    Method
    Description
    duplicate(boolean with_state)
     
     

    Methods inherited from class ca.uqac.lif.cep.functions.UnaryFunction

    evaluate, getInputArity, getInputTypesFor, getOutputArity, getOutputTypeFor, reset

    Methods inherited from class ca.uqac.lif.cep.functions.Function

    duplicate, evaluate, evaluate, evaluateLazy, evaluatePartial, printState, readState

    Methods inherited from class java.lang.Object

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

    • m_position

      protected int m_position
      The position to extract from each tuple
  • Constructor Details

    • PredicateGet

      public PredicateGet(int position)
      Creates an instance of the function
      Parameters:
      position - The position to extract in a tuple. If position = 0, the name of the predicate tuple will be returned. Otherwise, the value at index position-1 in the arguments will be returned. The value null will be returned if the index is out of bounds with respect to the tuple being given.
  • Method Details

    • getValue

      public Object getValue(PredicateTuple x)
      Specified by:
      getValue in class ca.uqac.lif.cep.functions.UnaryFunction<PredicateTuple,Object>
    • duplicate

      public PredicateGet duplicate(boolean with_state)
      Specified by:
      duplicate in interface ca.uqac.lif.cep.Duplicable
      Overrides:
      duplicate in class ca.uqac.lif.cep.functions.UnaryFunction<PredicateTuple,Object>