com.metamatrix.query.sql.symbol
Class AliasSymbol

java.lang.Object
  extended by com.metamatrix.query.sql.symbol.Symbol
      extended by com.metamatrix.query.sql.symbol.SelectSymbol
          extended by com.metamatrix.query.sql.symbol.SingleElementSymbol
              extended by com.metamatrix.query.sql.symbol.AliasSymbol
All Implemented Interfaces:
LanguageObject, Expression, java.io.Serializable, java.lang.Cloneable

public class AliasSymbol
extends SingleElementSymbol

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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.metamatrix.query.sql.symbol.SingleElementSymbol
SEPARATOR
 
Constructor Summary
AliasSymbol(java.lang.String name, SingleElementSymbol symbol)
          Construct an AliasSymbol given the alias name and the underlying symbol.
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 java.lang.Object clone()
          Return a copy of this object.
 boolean equals(java.lang.Object obj)
          Compare the symbol based ONLY on name.
 SingleElementSymbol getSymbol()
          Get the underlying symbol
 java.lang.Class getType()
          Get the type of the symbol
 boolean isResolved()
          Returns true if this symbol has been completely resolved with respect to actual runtime metadata.
 void setSymbol(SingleElementSymbol symbol)
          Set the underlying symbol
 
Methods inherited from class com.metamatrix.query.sql.symbol.SingleElementSymbol
getShortCanonicalName, getShortName, getShortName
 
Methods inherited from class com.metamatrix.query.sql.symbol.Symbol
getCanonical, getCanonicalName, getName, getOutputName, hashCode, setName, setOutputName, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AliasSymbol

public AliasSymbol(java.lang.String name,
                   SingleElementSymbol 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 SingleElementSymbol getSymbol()
Get the underlying symbol

Returns:
Underlying symbol

setSymbol

public void setSymbol(SingleElementSymbol symbol)
Set the underlying symbol

Parameters:
symbol - New symbol

getType

public java.lang.Class getType()
Get the type of the symbol

Returns:
Type of the symbol

isResolved

public boolean isResolved()
Returns true if this symbol has been completely resolved with respect to actual runtime metadata. A resolved symbol has been validated that it refers to actual metadata and will have references to the real metadata IDs if necessary. Different types of symbols determine their resolution in different ways, so this method is abstract and must be implemented by subclasses.

Specified by:
isResolved in interface Expression
Specified by:
isResolved in class Symbol
Returns:
True if resolved with runtime metadata

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.

Parameters:
visitor - Visitor being used

clone

public java.lang.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(java.lang.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)


Copyright © 2009. All Rights Reserved.