|
||||||||||
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! |
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 |
isMultiValued()
|
boolean |
isNull()
Return true if the constant is null. |
boolean |
isResolved()
Return true if expression has been fully resolved. |
void |
setMultiValued(java.util.List<?> 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 |
---|
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 nullMethod Detail |
---|
public java.lang.Class getType()
getType
in interface Expression
public java.lang.Object getValue()
public boolean isNull()
public boolean isResolved()
isResolved
in interface Expression
public void setMultiValued(java.util.List<?> value)
public boolean isMultiValued()
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
visitor
- Visitor being usedpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Other object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in interface LanguageObject
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |