|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.query.sql.symbol.Constant
public class Constant
This class represents a literal value in a SQL string. The Constant object has a value and a type for that value. In many cases, the type can be derived from the type of the value, but that is not true if the value is null. In that case, the type is unknown and is set to the null type until the type is resolved at a later point.
| Constructor Summary | |
|---|---|
Constant(java.lang.Object value)
Construct a constant with a value, which may be null. |
|
Constant(java.lang.Object value,
java.lang.Class type)
Construct a typed constant. |
|
| Method Summary | |
|---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor. |
java.lang.Object |
clone()
Return a shallow copy of this object - value is NOT cloned! |
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object obj)
Compare this constant to another constant for equality. |
java.lang.Class |
getType()
Get type of constant, if known |
java.lang.Object |
getValue()
Get value of constant |
int |
hashCode()
Define hash code to be that of the underlying object to make it stable. |
boolean |
isNull()
Return true if the constant is null. |
boolean |
isResolved()
Return true if expression has been fully resolved. |
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 |
|---|
public Constant(java.lang.Object value,
java.lang.Class type)
value - Constant value, may be nulltype - Type for the constant, should never be nullpublic Constant(java.lang.Object value)
value - Constant value, may be null| Method Detail |
|---|
public java.lang.Class getType()
getType in interface Expressionpublic java.lang.Object getValue()
public boolean isNull()
public boolean isResolved()
isResolved in interface Expressionpublic void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor in interface LanguageObjectvisitor - Visitor being usedpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Other object
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in interface LanguageObjectclone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public int compareTo(java.lang.Object o)
throws java.lang.ClassCastException
compareTo in interface java.lang.Comparablejava.lang.ClassCastExceptionComparable.compareTo(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||