| java.lang.Object org.josql.expressions.Expression org.josql.expressions.ValueExpression org.josql.expressions.ConstantExpression
ConstantExpression | public class ConstantExpression extends ValueExpression (Code) | | This class represents a constant String or number.
ALL numbers in JoSQL are represented by double.
|
Method Summary | |
public Object | evaluate(Object o, Query q) Get the value of this constant.
Parameters: o - The current object, not used in this method. Parameters: q - The Query object, not used in this method. | public Class | getExpectedReturnType(Query q) Get the expected return type.
Will be either: java.lang.String.class
or: java.lang.Double.class .
Parameters: q - The Query object. | public Object | getValue(Object o, Query q) Get the value of this constant.
Parameters: o - The current object, not used in this method. Parameters: q - The Query object, not used in this method. | public boolean | hasFixedResult(Query q) Always returns true , well duh!
Parameters: q - The Query object. | public void | init(Query q) | public boolean | isTrue(Object o, Query q) Returns whether the value of this constant represents a true
value. | public void | setValue(Object v) | public String | toString() Returns a string representation of this constant.
If the constant is a String then it should be noted that the original
quoting character is not kept in this class and the output of this method
will contain the character "'" instead. |
evaluate | public Object evaluate(Object o, Query q)(Code) | | Get the value of this constant.
Parameters: o - The current object, not used in this method. Parameters: q - The Query object, not used in this method. The constant value. |
getExpectedReturnType | public Class getExpectedReturnType(Query q)(Code) | | Get the expected return type.
Will be either: java.lang.String.class
or: java.lang.Double.class .
Parameters: q - The Query object. The expected class. |
getValue | public Object getValue(Object o, Query q)(Code) | | Get the value of this constant.
Parameters: o - The current object, not used in this method. Parameters: q - The Query object, not used in this method. The constant value. |
hasFixedResult | public boolean hasFixedResult(Query q)(Code) | | Always returns true , well duh!
Parameters: q - The Query object. true always. |
init | public void init(Query q)(Code) | | Inits the expression, in reality does nothing here, can't init a constant!
Parameters: q - The Query object. |
isTrue | public boolean isTrue(Object o, Query q)(Code) | | Returns whether the value of this constant represents a true
value. See:
ArithmeticExpression.isTrue(ObjectQuery) for details of how
the return value is determined.
Parameters: o - The current object. Not used in this method. Parameters: q - The Query object. true if the constant evaluates to true . |
toString | public String toString()(Code) | | Returns a string representation of this constant.
If the constant is a String then it should be noted that the original
quoting character is not kept in this class and the output of this method
will contain the character "'" instead.
If the constant is a number then "toString" is called on it, so any ","
or other number formatting will have been lost.
A string representation of this constant. |
|
|