public class ExpressionList extends ValueExpression
| 构造器和说明 |
|---|
ExpressionList() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addExpression(Expression expr)
Add an expression to the list.
|
Object |
evaluate(Object o,
Query q)
Evaluates the value of this expression list.
|
Class |
getExpectedReturnType(Query q)
Get the expected return type, which is
List. |
List |
getExpressions()
Returns the expressions, a list of
Expression objects. |
Object |
getValue(Object o,
Query q)
Gets the value of the expressions, this will return a list of the values for
each of the expressions in the list.
|
boolean |
hasFixedResult(Query q)
Returns
true if this expression list is empty (no expressions) or
if ALL of the expressions have a fixed result. |
void |
init(Query q)
Initialises this expression list, each expression in the list is inited.
|
boolean |
isTrue(Object o,
Query q)
Returns
true if one of the expression values is non-null. |
void |
setExpressions(List exprs)
Set the expressions.
|
String |
toString()
Returns a string version of this expression list.
|
isBracketed, setBracketedpublic Class getExpectedReturnType(Query q)
List.getExpectedReturnType 在类中 Expressionq - The Query object.List.public void init(Query q) throws QueryParseException
init 在类中 Expressionq - The Query object.QueryParseException - If one of the expressions cannot be inited.public List getExpressions()
Expression objects.public void addExpression(Expression expr)
expr - The expression.public void setExpressions(List exprs)
exprs - The expressions.public Object getValue(Object o, Query q) throws QueryExecutionException
Expression.getValue(Object,Query)
is called on each of the expressions.getValue 在类中 ValueExpressiono - The current object.q - The Query object.QueryExecutionException - If something goes wrong the acquisition of the values.public boolean isTrue(Object o, Query q) throws QueryExecutionException
true if one of the expression values is non-null.
Note: for efficiency this method calls Expression.getValue(Object,Query)
on each expression directly and returns true for the first non-null
value found, as such if any of your expressions triggers side-effects then this
method should not be used.isTrue 在类中 Expressiono - The current object.q - The Query object.true if one of the expression values is non-null.QueryExecutionException - If a problem occurs during evaluation.public Object evaluate(Object o, Query q) throws QueryExecutionException
getValue(Object,Query).evaluate 在类中 ValueExpressiono - The current object.q - The Query object.QueryExecutionException - If there is a problem getting the values.public String toString()
toString 在类中 Expressionpublic boolean hasFixedResult(Query q)
true if this expression list is empty (no expressions) or
if ALL of the expressions have a fixed result.hasFixedResult 在类中 Expressionq - The Query object.Copyright © 2021. All rights reserved.