Package org.teiid.query.sql.symbol
Class AliasSymbol
- java.lang.Object
-
- org.teiid.query.sql.symbol.Symbol
-
- org.teiid.query.sql.symbol.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Field Summary
-
Fields inherited from class org.teiid.query.sql.symbol.Symbol
outputName, SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description AliasSymbol(String name, Expression symbol)
Construct an AliasSymbol given the alias name and the underlying symbol.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.Object
clone()
Return a copy of this object.boolean
equals(Object obj)
Compare the symbol based ONLY on name.Expression
getSymbol()
Get the underlying symbolClass<?>
getType()
Get the type of the symbolvoid
setSymbol(Expression symbol)
Set the underlying symbol-
Methods inherited from class org.teiid.query.sql.symbol.Symbol
getName, getName, getOutputName, getOutputName, getShortName, getShortName, getShortName, hashCode, setName, setOutputName, setShortName, toString
-
-
-
-
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 aliassymbol
- 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 interfaceExpression
- 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 interfaceLanguageObject
- Parameters:
visitor
- Visitor being used
-
clone
public Object clone()
Return a copy of this object.- Specified by:
clone
in interfaceLanguageObject
- Specified by:
clone
in classSymbol
- 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 classSymbol
- 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)
-
-