public class InExpression extends BinaryExpression
for
construct rather than an Iterator since it's much faster.
Note: due to the way that the expression is designed it is POSSIBLE to have a binary expression
in the in list, however at this time that is not supported since it can lead to an ambiguous result,
for example: true IN (true, false)
has no sensible meaning.
left, right
Constructor and Description |
---|
InExpression() |
Modifier and Type | Method and Description |
---|---|
void |
addItem(Expression e) |
List |
getItems() |
void |
init(Query q)
Initialise the IN expression.
|
boolean |
isAll() |
boolean |
isDoLike() |
boolean |
isIgnoreCase() |
boolean |
isNot() |
boolean |
isTrue(Object o,
Query q)
Return whether this expression evaulates to
true . |
void |
setAll(boolean v) |
void |
setDoLike(boolean d) |
void |
setIgnoreCase(boolean v) |
void |
setItems(List items) |
void |
setNot(boolean v) |
String |
toString()
Return a string representation of this expression.
|
getExpectedReturnType, getLeft, getRight, getValue, hasFixedResult, setLeft, setRight
isBracketed, setBracketed
public void init(Query q) throws QueryParseException
init
in class BinaryExpression
q
- The Query object.QueryParseException
- If something goes wrong with the init.public void setIgnoreCase(boolean v)
public boolean isIgnoreCase()
public boolean isAll()
public void setAll(boolean v)
public boolean isDoLike()
public void setDoLike(boolean d)
public void setItems(List items)
public List getItems()
public void addItem(Expression e)
public boolean isNot()
public void setNot(boolean v)
public boolean isTrue(Object o, Query q) throws QueryExecutionException
true
. If any of the values on RHS are Maps (keys
only) or Collections then they are iterated over and checked against the LHS.isTrue
in class Expression
o
- The current object to perform the expression on.q
- The Query object.true
if the LHS is "equal" (as determined by: Utilities.isEquals(Object,Object)
)
to any of the values in the brackets. If this is a NOT expression then the result is negated.QueryExecutionException
- If the expression cannot be evaluated.public String toString()
Expression
[ NOT ] [$]IN [ LIKE ] [ ALL ]
( Expression
[ , Expression
* ] )toString
in class Expression