| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.josql.expressions.Expression
org.josql.expressions.ValueExpression
org.josql.expressions.ConstantExpression
public class ConstantExpression
This class represents a constant String or number. ALL numbers in JoSQL are represented by double.
| Constructor Summary | |
|---|---|
| ConstantExpression() | |
| Method Summary | |
|---|---|
|  Object | evaluate(Object o,
         Query q)Get the value of this constant. | 
|  Class | getExpectedReturnType(Query q)Get the expected return type. | 
|  Object | getValue(Object o,
         Query q)Get the value of this constant. | 
|  boolean | hasFixedResult(Query q)Always returns true, well duh! | 
|  void | init(Query q)Inits the expression, in reality does nothing here, can't init a constant! | 
|  boolean | isTrue(Object o,
       Query q)Returns whether the value of this constant represents a truevalue. | 
|  void | setValue(Object v) | 
|  String | toString()Returns a string representation of this constant. | 
| Methods inherited from class org.josql.expressions.Expression | 
|---|
| isBracketed, setBracketed | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public ConstantExpression()
| Method Detail | 
|---|
public Class getExpectedReturnType(Query q)
java.lang.String.class
 or: java.lang.Double.class.
getExpectedReturnType in class Expressionq - The Query object.
public void init(Query q)
init in class Expressionq - The Query object.public void setValue(Object v)
public boolean isTrue(Object o,
                      Query q)
true
 value.  See: ArithmeticExpression.isTrue(Object,Query) for details of how
 the return value is determined.
isTrue in class Expressiono - The current object.  Not used in this method.q - The Query object.
true if the constant evaluates to true.
public Object getValue(Object o,
                       Query q)
getValue in class ValueExpressiono - The current object, not used in this method.q - The Query object, not used in this method.
public Object evaluate(Object o,
                       Query q)
evaluate in class ValueExpressiono - The current object, not used in this method.q - The Query object, not used in this method.
public boolean hasFixedResult(Query q)
true, well duh!
hasFixedResult in class Expressionq - The Query object.
true always.public String toString()
toString in class Expression| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||