Class GlobalNamespace

  • All Implemented Interfaces:
    Namespace

    public class GlobalNamespace
    extends java.lang.Object
    implements Namespace
    The global namespace implementation class
    • Constructor Summary

      Constructors 
      Constructor Description
      GlobalNamespace​(Memory memory)
      Constructs a new GlobalNamespace
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      AddressSetView getBody()
      Get the address set for this namespace.
      long getID()
      Return the namespace id
      java.lang.String getName()
      Get the name of the symbol for this scope
      java.lang.String getName​(boolean includeNamespacePath)
      Returns the fully qualified name
      Namespace getParentNamespace()
      Get the parent scope.
      Symbol getSymbol()
      Get the symbol for this namespace; Note: The global namespace will return null
      boolean isExternal()
      Returns true if this namespace is external (i.e., associated with a Library)
      void setParentNamespace​(Namespace parentNamespace)
      Set the parent namespace for this namespace.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • GLOBAL_NAMESPACE_NAME

        public static final java.lang.String GLOBAL_NAMESPACE_NAME
        Global namespace name which may (incorrectly) appear as the first element within a namespace path (e.g., Global::Foo::Bar). It is preferred that the Global namespace be omitted in favor of Foo::Bar.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GlobalNamespace

        public GlobalNamespace​(Memory memory)
        Constructs a new GlobalNamespace
        Parameters:
        memory - the memory associated with this global namespace
    • Method Detail

      • getSymbol

        public Symbol getSymbol()
        Description copied from interface: Namespace
        Get the symbol for this namespace; Note: The global namespace will return null
        Specified by:
        getSymbol in interface Namespace
        Returns:
        the symbol for this namespace; Note: The global namespace will return null
        See Also:
        Namespace.getSymbol()
      • getName

        public java.lang.String getName()
        Description copied from interface: Namespace
        Get the name of the symbol for this scope
        Specified by:
        getName in interface Namespace
        Returns:
        the name of the symbol for this scope
        See Also:
        Namespace.getName()
      • getBody

        public AddressSetView getBody()
        Description copied from interface: Namespace
        Get the address set for this namespace. Note: The body of a namespace (currently only used by the function namespace) is restricted it Integer.MAX_VALUE.
        Specified by:
        getBody in interface Namespace
        Returns:
        the address set for this namespace
        See Also:
        Namespace.getBody()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • getName

        public java.lang.String getName​(boolean includeNamespacePath)
        Description copied from interface: Namespace
        Returns the fully qualified name
        Specified by:
        getName in interface Namespace
        Parameters:
        includeNamespacePath - true to include the namespace in the returned name
        Returns:
        the fully qualified name
        See Also:
        Namespace.getName(boolean)
      • isExternal

        public boolean isExternal()
        Description copied from interface: Namespace
        Returns true if this namespace is external (i.e., associated with a Library)
        Specified by:
        isExternal in interface Namespace
        Returns:
        true if this namespace is external (i.e., associated with a Library)