Class AliasSymbol

  • All Implemented Interfaces:
    Cloneable, LanguageObject, DerivedExpression, Expression

    public class AliasSymbol
    extends Symbol
    implements DerivedExpression
    An AliasSymbol wraps a SingleElementSymbol and changes it's name. AliasSymbols should be used to perform the aliasing of elements in a SELECT clause. They should typically NOT be used elsewhere in a query. The alias symbol takes on the type of it's underlying SingleElementSymbol. AliasSymbols are typically applied to ElementSymbol, ExpressionSymbol, and AggregateSymbol.
    • Constructor Detail

      • AliasSymbol

        public AliasSymbol​(String name,
                           Expression symbol)
        Construct an AliasSymbol given the alias name and the underlying symbol.
        Parameters:
        name - Name of the alias
        symbol - Underlying symbol
    • Method Detail

      • getSymbol

        public Expression getSymbol()
        Get the underlying symbol
        Returns:
        Underlying symbol
      • setSymbol

        public void setSymbol​(Expression symbol)
        Set the underlying symbol
        Parameters:
        symbol - New symbol
      • getType

        public Class<?> getType()
        Get the type of the symbol
        Specified by:
        getType in interface Expression
        Returns:
        Type of the symbol
      • acceptVisitor

        public void acceptVisitor​(LanguageVisitor visitor)
        Description copied from interface: LanguageObject
        Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.
        Specified by:
        acceptVisitor in interface LanguageObject
        Parameters:
        visitor - Visitor being used
      • clone

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

        public boolean equals​(Object obj)
        Description copied from class: Symbol
        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 Symbol
        Parameters:
        obj - Other object
        Returns:
        True if other obj is a Symbol (or subclass) and name is equal
        See Also:
        Symbol.equals(java.lang.Object)