Class NameSpace

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

public class NameSpace
extends java.lang.Object
implements Directive
Implementation of the namespace directive.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String LOCAL_PREFIX  
    private java.util.Map<Atom,​Atom> localNSs  
    (package private) static java.util.logging.Logger logger  
    private static java.util.concurrent.atomic.AtomicInteger nsCounter  
    (package private) java.util.Stack<Atom> oldNS  
  • Constructor Summary

    Constructors
    Constructor Description
    NameSpace()  
  • Method Summary

    Modifier and Type Method Description
    private Atom addLocalNS​(Atom ns)  
    void begin​(Pred directive, jason.asSyntax.parser.as2j parser)
    called when the directive is declared
    void end​(Pred directive, jason.asSyntax.parser.as2j parser)
    called when the directive ends
    static int getUniqueID()  
    boolean isLocalNS​(Atom ns)  
    boolean isSingleton()
    returns true if the same instance will be used by all agents/parsers in the JVM
    Atom map​(Atom ns)  
    Agent process​(Pred directive, Agent outerContent, Agent innerContent)
    This method is called to process the directive.

    Methods inherited from class java.lang.Object

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

    • LOCAL_PREFIX

      public static final java.lang.String LOCAL_PREFIX
      See Also:
      Constant Field Values
    • logger

      static java.util.logging.Logger logger
    • localNSs

      private java.util.Map<Atom,​Atom> localNSs
    • oldNS

      java.util.Stack<Atom> oldNS
    • nsCounter

      private static java.util.concurrent.atomic.AtomicInteger nsCounter
  • Constructor Details

    • NameSpace

      public NameSpace()
  • Method Details

    • isSingleton

      public boolean isSingleton()
      Description copied from interface: Directive
      returns true if the same instance will be used by all agents/parsers in the JVM
      Specified by:
      isSingleton in interface Directive
    • 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
      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.
    • begin

      public void begin​(Pred directive, jason.asSyntax.parser.as2j parser)
      Description copied from interface: Directive
      called when the directive is declared
      Specified by:
      begin in interface Directive
    • end

      public void end​(Pred directive, jason.asSyntax.parser.as2j parser)
      Description copied from interface: Directive
      called when the directive ends
      Specified by:
      end in interface Directive
    • isLocalNS

      public boolean isLocalNS​(Atom ns)
    • map

      public Atom map​(Atom ns)
    • getUniqueID

      public static int getUniqueID()
    • addLocalNS

      private Atom addLocalNS​(Atom ns)