org.teiid.query.sql.symbol
Class Reference

java.lang.Object
  extended by org.teiid.query.sql.symbol.Reference
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, LanguageObject, ContextReference, Expression

public class Reference
extends java.lang.Object
implements Expression, ContextReference

This class represents a reference (positional from the user query, or to an element from another scope). This reference may resolve to many different values during evaluation. For any particular bound value, it is treated as a constant.

See Also:
Serialized Form

Nested Class Summary
static interface Reference.Constraint
           
 
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
 
Constructor Summary
Reference(ElementSymbol expression)
          Constructor for an element Reference.
Reference(int refIndex)
          Constructor for a positional Reference.
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 java.lang.Object clone()
          Implement clone to make objects cloneable.
 boolean equals(java.lang.Object obj)
          Compare this constant to another constant for equality.
 Reference.Constraint getConstraint()
           
 java.lang.String getContextSymbol()
           
 ElementSymbol getExpression()
           
 int getIndex()
           
 java.lang.Class<?> getType()
          Get the return type of this expression.
 Expression getValueExpression()
           
 int hashCode()
          Define hash code to be that of the underlying object to make it stable.
 boolean isCorrelated()
           
 boolean isPositional()
           
 boolean isResolved()
          Return true if expression has been fully resolved.
 void setConstraint(Reference.Constraint constraint)
           
 void setExpression(ElementSymbol expression)
          Should never be called - used for an xml hack
 void setType(java.lang.Class<?> type)
           
 java.lang.String toString()
          Return a String representation of this object using SQLStringVisitor.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Reference

public Reference(int refIndex)
Constructor for a positional Reference.


Reference

public Reference(ElementSymbol expression)
Constructor for an element Reference.

Method Detail

getConstraint

public Reference.Constraint getConstraint()

setConstraint

public void setConstraint(Reference.Constraint constraint)

isResolved

public boolean isResolved()
Description copied from interface: Expression
Return true if expression has been fully resolved. Typically the QueryResolver component will handle resolution of an expression.

Specified by:
isResolved in interface Expression
Returns:
True if resolved

getIndex

public int getIndex()

getContextSymbol

public java.lang.String getContextSymbol()
Specified by:
getContextSymbol in interface ContextReference

getValueExpression

public Expression getValueExpression()
Specified by:
getValueExpression in interface ContextReference

getExpression

public ElementSymbol getExpression()

getType

public java.lang.Class<?> getType()
Description copied from interface: Expression
Get the return type of this expression. This method will not necessarily work right before resolution (Expression.isResolved() returns true).

Specified by:
getType in interface Expression
Returns:
Java class name

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 java.lang.Object clone()
Description copied from interface: LanguageObject
Implement clone to make objects cloneable.

Specified by:
clone in interface LanguageObject
Overrides:
clone in class java.lang.Object
Returns:
Deep clone of this object
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object obj)
Compare this constant to another constant for equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object
Returns:
True if constants are equal

setType

public void setType(java.lang.Class<?> type)

hashCode

public int hashCode()
Define hash code to be that of the underlying object to make it stable.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code, based on value

toString

public java.lang.String toString()
Return a String representation of this object using SQLStringVisitor.

Overrides:
toString in class java.lang.Object
Returns:
String representation using SQLStringVisitor

isCorrelated

public boolean isCorrelated()

isPositional

public boolean isPositional()

setExpression

public void setExpression(ElementSymbol expression)
Should never be called - used for an xml hack

Parameters:
expression -


Copyright © 2010. All Rights Reserved.