Class Predicate

java.lang.Object
ca.uqac.lif.cep.functions.Function
ca.uqac.lif.cep.fol.Predicate
All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable, ca.uqac.lif.cep.functions.DuplicableFunction

public class Predicate extends ca.uqac.lif.cep.functions.Function
  • Field Details

    • m_name

      protected String m_name
      The predicate's name
    • m_domainNames

      protected String[] m_domainNames
      The predicate's domain name for each of its arguments
  • Constructor Details

    • Predicate

      public Predicate(String name, 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 Details

    • 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(Object[] inputs, boolean value)
    • updateDefinition

      public void updateDefinition(PredicateTuple tuple)
    • getDomainNames

      public String[] getDomainNames()
    • clear

      public void clear()
    • toString

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