Package org.teiid.query.sql.symbol
Class Reference
- java.lang.Object
-
- org.teiid.query.sql.symbol.Reference
-
- All Implemented Interfaces:
Cloneable
,LanguageObject
,ContextReference
,Expression
public class Reference extends 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Reference.Constraint
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Constructor Summary
Constructors Constructor Description Reference(int refIndex)
Constructor for a positional Reference.Reference(ElementSymbol expression)
Constructor for an element Reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.Object
clone()
Implement clone to make objects cloneable.boolean
equals(Object obj)
Compare this constant to another constant for equality.Reference.Constraint
getConstraint()
String
getContextSymbol()
ElementSymbol
getExpression()
int
getIndex()
Class<?>
getType()
Get the return type of this expression.int
hashCode()
Define hash code to be that of the underlying object to make it stable.boolean
isCorrelated()
boolean
isOptional()
boolean
isPositional()
void
setConstraint(Reference.Constraint constraint)
void
setExpression(ElementSymbol expression)
void
setOptional(boolean optional)
void
setType(Class<?> type)
String
toString()
Return a String representation of this object using SQLStringVisitor.
-
-
-
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)
-
getIndex
public int getIndex()
-
getContextSymbol
public String getContextSymbol()
- Specified by:
getContextSymbol
in interfaceContextReference
-
getExpression
public ElementSymbol getExpression()
-
getType
public Class<?> getType()
Description copied from interface:Expression
Get the return type of this expression.- Specified by:
getType
in interfaceExpression
- Returns:
- Java class may be null prior to being resolved
-
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()
Description copied from interface:LanguageObject
Implement clone to make objects cloneable.- Specified by:
clone
in interfaceLanguageObject
- Overrides:
clone
in classObject
- Returns:
- Deep clone of this object
- See Also:
Object.clone()
-
equals
public boolean equals(Object obj)
Compare this constant to another constant for equality.
-
setType
public void setType(Class<?> type)
-
hashCode
public int hashCode()
Define hash code to be that of the underlying object to make it stable.
-
toString
public String toString()
Return a String representation of this object using SQLStringVisitor.
-
isCorrelated
public boolean isCorrelated()
-
isPositional
public boolean isPositional()
-
setExpression
public void setExpression(ElementSymbol expression)
-
isOptional
public boolean isOptional()
-
setOptional
public void setOptional(boolean optional)
-
-