com.metamatrix.query.sql.symbol
Class Reference

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

public class Reference
extends java.lang.Object
implements Expression

This class represents a reference within a SQL statement to some other source of data. 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

Constructor Summary
Reference(int refIndex)
          Constructor for Reference.
Reference(int refIndex, Expression expression)
          Constructor for 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.
 java.util.Map getDataElements()
           
 Expression getExpression()
           
 int getIndex()
           
 java.util.List getTuple()
           
 java.lang.Class getType()
          Get the return type of this expression.
 java.lang.Object getValue(LookupEvaluator dataMgr, CommandContext context)
           
 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 setCorrelated(boolean correlated)
           
 void setData(java.util.Map elements, java.util.List tuple)
          Set value provider for this reference
 void setExpression(Expression expression)
           
 void setPositional(boolean positional)
           
 void setValue(java.lang.Object value)
           
 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 Reference.


Reference

public Reference(int refIndex,
                 Expression expression)
Constructor for Reference.

Method Detail

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()

setExpression

public void setExpression(Expression expression)

getExpression

public Expression 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

setData

public void setData(java.util.Map elements,
                    java.util.List tuple)
Set value provider for this reference

Parameters:
provider - Provider of values for this reference

getDataElements

public java.util.Map getDataElements()

getTuple

public java.util.List getTuple()

getValue

public java.lang.Object getValue(LookupEvaluator dataMgr,
                                 CommandContext context)
                          throws ExpressionEvaluationException,
                                 MetaMatrixComponentException
Throws:
ExpressionEvaluationException
MetaMatrixComponentException

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

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()

setCorrelated

public void setCorrelated(boolean correlated)

setValue

public void setValue(java.lang.Object value)

isPositional

public boolean isPositional()

setPositional

public void setPositional(boolean positional)


Copyright © 2009. All Rights Reserved.