public class ConstantExpression extends ValueExpression
| 构造器和说明 |
|---|
ConstantExpression() |
| 限定符和类型 | 方法和说明 |
|---|---|
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
true
value. |
void |
setValue(Object v) |
String |
toString()
Returns a string representation of this constant.
|
isBracketed, setBracketedpublic Class getExpectedReturnType(Query q)
java.lang.String.class
or: java.lang.Double.class.getExpectedReturnType 在类中 Expressionq - The Query object.public void init(Query q)
init 在类中 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 在类中 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 在类中 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 在类中 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 在类中 Expressionq - The Query object.true always.public String toString()
toString 在类中 ExpressionCopyright © 2021. All rights reserved.