Class Predicate

  • 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 Predicate
    extends ca.uqac.lif.cep.functions.Function
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Predicate.PredicateArgument  
      static class  Predicate.Wildcard
      Special constant that can be used when evaluating a predicate to indicate a "don't care" value
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String[] m_domainNames
      The predicate's domain name for each of its arguments
      protected java.lang.String m_name
      The predicate's name
      • Fields inherited from class ca.uqac.lif.cep.functions.Function

        s_maxInputArity
    • Constructor Summary

      Constructors 
      Constructor Description
      Predicate​(Predicate pred)
      Creates a new predicate by copying its contents from another predicate
      Predicate​(java.lang.String name, java.lang.String... domain_names)
      Creates a new predicate
    • Field Detail

      • m_name

        protected java.lang.String m_name
        The predicate's name
      • m_domainNames

        protected java.lang.String[] m_domainNames
        The predicate's domain name for each of its arguments
    • Constructor Detail

      • Predicate

        public Predicate​(java.lang.String name,
                         java.lang.String... domain_names)
        Creates a new predicate
        Parameters:
        name - The name of the predicate
        domain_names - The name of the domains for each of its arguments
      • Predicate

        public Predicate​(Predicate pred)
        Creates a new predicate by copying its contents from another predicate
        Parameters:
        pred - The predicate to copy from
    • Method Detail

      • addDefinition

        public void addDefinition​(Predicate.PredicateArgument arguments,
                                  boolean value)
        Adds a new tuple to the definition of this predicate
        Parameters:
        arguments - The arguments
        value - The value associated to these arguments
      • updateDefinition

        public void updateDefinition​(java.lang.Object[] inputs,
                                     boolean value)
      • updateDefinition

        public void updateDefinition​(PredicateTuple tuple)
      • getDomainNames

        public java.lang.String[] getDomainNames()
      • clear

        public void clear()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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
      • 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 Predicate 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