Class Symbol

  • All Implemented Interfaces:
    Cloneable, LanguageObject
    Direct Known Subclasses:
    AliasSymbol, ElementSymbol, ExpressionSymbol, GroupSymbol

    public abstract class Symbol
    extends Object
    implements LanguageObject
    This is the server's representation of a metadata symbol. The only thing a symbol has to have is a name. This name relates only to how a symbol is specified in a user's query and does not necessarily relate to any actual metadata identifier (although it may). Subclasses of this class provide specialized instances of symbol for various circumstances in a user's query. In the context of a single query, a symbol's name has a unique meaning although it may be used more than once in some circumstances.
    • Field Detail

      • outputName

        protected String outputName
        Prior to resolving null, after resolving it is the exact string entered in the query. The AliasGenerator can also set this value as necessary for the data tier.
      • SEPARATOR

        public static final String SEPARATOR
        Character used to delimit name components in a symbol
        See Also:
        Constant Field Values
    • Constructor Detail

      • Symbol

        public Symbol​(String name)
        Construct a symbol with a name.
        Parameters:
        name - Name of the symbol
        Throws:
        IllegalArgumentException - If name is null
      • Symbol

        public Symbol()
    • Method Detail

      • setName

        protected void setName​(String name)
      • setShortName

        public void setShortName​(String name)
        Change the symbol's name. This will change the symbol's hash code and canonical name!!!!!!!!!!!!!!!!! If this symbol is in a hashed collection, it will be lost!
        Parameters:
        name - New name
      • getName

        public String getName()
        Get the name of the symbol
        Returns:
        Name of the symbol, never null
      • toString

        public String toString()
        Returns string representation of this symbol.
        Overrides:
        toString in class Object
        Returns:
        String representing the symbol
      • hashCode

        public int hashCode()
        Return a hash code for this symbol.
        Overrides:
        hashCode in class Object
        Returns:
        Hash code
      • equals

        public boolean equals​(Object obj)
        Compare the symbol based ONLY on name. Symbols are not compared based on their underlying physical metadata IDs but rather on their representation in the context of a particular query. Case is not important when comparing symbol names.
        Overrides:
        equals in class Object
        Parameters:
        obj - Other object
        Returns:
        True if other obj is a Symbol (or subclass) and name is equal
      • clone

        public abstract Object clone()
        Return a copy of this object.
        Specified by:
        clone in interface LanguageObject
        Overrides:
        clone in class Object
        Returns:
        Deep clone of this object
      • getOutputName

        public String getOutputName()
      • setOutputName

        public void setOutputName​(String outputName)
      • getShortName

        public final String getShortName()
        Get the short name of the element
        Returns:
        Short name of the symbol (un-dotted)
      • getShortName

        public static String getShortName​(String name)