|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.josql.expressions.Expression org.josql.expressions.BinaryExpression
public abstract class BinaryExpression
Super-class of Expressions that return a binary result.
A binary expression must always have a LHS. The RHS is optional.
Field Summary | |
---|---|
protected Expression |
left
|
protected Expression |
right
|
Constructor Summary | |
---|---|
BinaryExpression()
|
Method Summary | |
---|---|
Class |
getExpectedReturnType(Query q)
Return the expected return type from this expression. |
Expression |
getLeft()
Get the LHS. |
Expression |
getRight()
Get the RHS. |
Object |
getValue(Object o,
Query q)
Get the value of this expression. |
boolean |
hasFixedResult(Query q)
Return whether this expression, and more specifically the left and right parts of the expression return a fixed result. |
void |
init(Query q)
Init the expression. |
void |
setLeft(Expression exp)
|
void |
setRight(Expression exp)
|
Methods inherited from class org.josql.expressions.Expression |
---|
isBracketed, isTrue, setBracketed, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Expression left
protected Expression right
Constructor Detail |
---|
public BinaryExpression()
Method Detail |
---|
public boolean hasFixedResult(Query q)
hasFixedResult
in class Expression
q
- The Query object.
true if the expression has a fixed result.
public Class getExpectedReturnType(Query q)
getExpectedReturnType
in class Expression
q
- The Query object.
Boolean.class
.public void init(Query q) throws QueryParseException
Expression.init(Query)
on the LHS and RHS (if present) of the
expression.
init
in class Expression
q
- The Query object.
QueryParseException
- If the LHS and/or RHS cannot be inited.public Object getValue(Object o, Query q) throws QueryExecutionException
java.lang.Boolean
created as the result of a call to:
Expression.getValue(Object,Query)
.
getValue
in class Expression
o
- The object to evaluate the expression on.q
- The Query object.
QueryExecutionException
- If the expression cannot be evaluated.public Expression getRight()
public Expression getLeft()
public void setLeft(Expression exp)
public void setRight(Expression exp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |