Class LibrarySymbol

All Implemented Interfaces:
Symbol, Comparable<LibrarySymbol>

public class LibrarySymbol extends SymbolDB implements Comparable<LibrarySymbol>
Class for library symbols. Symbol data usage: String stringData - associated program project file path
  • Method Details

    • setNameAndNamespace

      public void setNameAndNamespace(String newName, Namespace newNamespace, SourceType source) throws DuplicateNameException, InvalidInputException, CircularDependencyException
      Description copied from interface: Symbol
      Sets the symbols name and namespace. This is provided to allow the caller to avoid a name conflict by creating an autonomous action.
      Specified by:
      setNameAndNamespace in interface Symbol
      Overrides:
      setNameAndNamespace in class SymbolDB
      Parameters:
      newName - new symbol name
      newNamespace - new parent namespace
      source - the source of this symbol
      Some symbol types, such as function symbols, can set the source to Symbol.DEFAULT.
      Throws:
      DuplicateNameException - if newNamespace already contains a symbol with this symbol's name
      InvalidInputException - is newNamespace is not a valid parent for this symbol
      CircularDependencyException - if this symbol is an ancestor of newNamespace
    • delete NEW

      public boolean delete()
      Description copied from interface: Symbol
      Delete the symbol and its associated resources. Any references symbol associations will be discarded.
      Specified by:
      delete in interface Symbol
      Overrides:
      delete in class SymbolDB
      Returns:
      true if successful
    • getSymbolType

      public SymbolType getSymbolType()
      Description copied from interface: Symbol
      Returns this symbol's type
      Specified by:
      getSymbolType in interface Symbol
      Returns:
      symbol type
    • isExternal

      public boolean isExternal()
      Description copied from interface: Symbol
      Returns true if this an external symbol.
      Specified by:
      isExternal in interface Symbol
      Returns:
      true if this an external symbol.
      See Also:
    • getObject

      public Library getObject()
      Specified by:
      getObject in interface Symbol
      Returns:
      object associated with this symbol or null if symbol has been deleted
    • isPrimary

      public boolean isPrimary()
      Specified by:
      isPrimary in interface Symbol
      Specified by:
      isPrimary in class SymbolDB
      Returns:
      true if this symbol is primary
    • isValidParent

      public boolean isValidParent(Namespace parent)
      Description copied from interface: Symbol
      Determines if the given parent is valid for this Symbol. Specified namespace must belong to the same symbol table as this symbol.
      Specified by:
      isValidParent in interface Symbol
      Overrides:
      isValidParent in class SymbolDB
      Parameters:
      parent - prospective parent namespace for this symbol
      Returns:
      true if parent is valid
    • getOrdinal NEW

      public int getOrdinal()
      Returns Library's ordinal placement within ordered library list..
      Returns:
      Library's ordinal placement within ordered library list.
    • setOrdinal NEW

      public void setOrdinal(int ordinal)
      Set the Library ordinal. Other Library ordinals will be adjusted if displaced by ordinal change. No change is made if this Library symbol corresponds to Library.UNKNOWN Library.
      Parameters:
      ordinal - positive greater or equal to 0.
      Throws:
      IllegalArgumentException - if a negative ordinal is specified
    • getExternalLibraryPath

      public String getExternalLibraryPath()
      Returns the library program path within the project (may be null).
      Returns:
      the library program path within the project (may be null)
    • setExternalLibraryPath MODIFIED

      public void setExternalLibraryPath(String libraryPath) throws InvalidInputException
      added throws InvalidInputException
      -void setExternalLibraryPath(java.lang.String libraryPath)
      +void setExternalLibraryPath(java.lang.String libraryPath) throws InvalidInputException
      Set the library program path within the project. The Library.UNKNOWN Library path may only be cleared.
      Parameters:
      libraryPath - library program path or null to clear
      Throws:
      InvalidInputException - if an invalid project file path is specified
    • validateExternalPath NEW

      public static void validateExternalPath(String path) throws InvalidInputException
      Perform path validation for an external library path within the project
      Parameters:
      path - external library path within the project (null is allowed for clearing path)
      Throws:
      InvalidInputException - if path is invalid
    • compareTo NEW

      public int compareTo(LibrarySymbol o)
      Specified by:
      compareTo in interface Comparable<LibrarySymbol>