Class FunctionRegister

java.lang.Object
jason.asSyntax.directives.DefaultDirective
jason.asSyntax.directives.FunctionRegister
All Implemented Interfaces:
Directive

public class FunctionRegister
extends DefaultDirective
implements Directive
This class maintains the set of arithmetic functions available for the AS parser.
Author:
Jomi
  • Field Summary

    Fields
    Modifier and Type Field Description
    private static java.util.Map<java.lang.String,​ArithFunction> functions  
    (package private) static java.util.logging.Logger logger  
  • Constructor Summary

    Constructors
    Constructor Description
    FunctionRegister()  
  • Method Summary

    Modifier and Type Method Description
    static void addFunction​(java.lang.Class<? extends ArithFunction> c)
    add new global function (shared among all agents in the JVM)
    private static void addJasonFunction​(java.lang.Class<? extends ArithFunction> c)  
    static java.lang.String checkFunctionName​(java.lang.String fName)  
    static ArithFunction getFunction​(java.lang.String function, int arity)  
    Agent process​(Pred directive, Agent outerContent, Agent innerContent)
    This method is called to process the directive.

    Methods inherited from class jason.asSyntax.directives.DefaultDirective

    begin, end, isSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jason.asSyntax.directives.Directive

    begin, end, isSingleton
  • Field Details

    • logger

      static java.util.logging.Logger logger
    • functions

      private static java.util.Map<java.lang.String,​ArithFunction> functions
  • Constructor Details

    • FunctionRegister

      public FunctionRegister()
  • Method Details

    • addJasonFunction

      private static void addJasonFunction​(java.lang.Class<? extends ArithFunction> c)
    • addFunction

      public static void addFunction​(java.lang.Class<? extends ArithFunction> c)
      add new global function (shared among all agents in the JVM)
    • checkFunctionName

      public static java.lang.String checkFunctionName​(java.lang.String fName)
    • getFunction

      public static ArithFunction getFunction​(java.lang.String function, int arity)
    • process

      public Agent process​(Pred directive, Agent outerContent, Agent innerContent)
      Description copied from interface: Directive
      This method is called to process the directive.
      Specified by:
      process in interface Directive
      Overrides:
      process in class DefaultDirective
      Parameters:
      directive - the directive as defined in the source (e.g. "include("bla.asl")")
      outerContent - the representation of the agent where the directive is being processed (the method should not change this agent state)
      innerContent - the content (plans, beliefs, ...) inside the begin/end directive (as in goal patterns)
      Returns:
      the agent (plans, bels, ...) with the result of the directive.