Interface AliasedSymbol

All Known Subinterfaces:
TypeComparator.AliasedSemanticSymbol
All Known Implementing Classes:
AliasedSymbol.AliasedSymbolImpl, AliasedSymbol.NoneAliasedSymbol, CompoundType, ConstantDefinition, FunctionSymbol, StructType, UnionType

public interface AliasedSymbol
Supports symbol aliasing, i.e. renaming, while preserving all its original names, i.e. aliases.
  • Method Details

    • rename

      void rename(String newName)
      Rename this symbol with the given newName if not equal current-name.

      Before renaming the current-name will be added to the list of aliases. while the given newName will be removed.

      Operation will be ignored if newName is null.

      Parameters:
      newName - the new current-name, maybe null
    • addAliasedName

      void addAliasedName(String origName)
      Add the given origName to the list of aliases if not equal current-name.

      Operation will be ignored if newName is null.

      Parameters:
      origName - the new alias to be added, maybe null
    • hasAliases

      boolean hasAliases()
      Returns true if this symbol has aliases, i.e. either being renamed or aliases-added.

      Otherwise false is being returned.

    • getAliasedNames

      Set<String> getAliasedNames()
      Return all aliases for this symbol, i.e. original names, for this symbol.

      Inclusive original-name, if renamed,

      Exclusive current-name.

      May return null or a zero sized Set for no aliases.

    • getOrigName

      String getOrigName()
      Return the original-name as set at creation.
    • getName

      String getName()
      Return the current-name, which is the last renamed-name if issued, or the original-name.
    • getAliasedString

      String getAliasedString()
      Return this object's #toString() wrapped w/ the current-name and all aliases.