|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
getExpectedReturnType
public Class getExpectedReturnType(Query q)
- Return the expected return type from this expression.
- Specified by:
getExpectedReturnType
in class Expression
- Parameters:
q
- The Query object.
- Returns:
- The class of the return type, this method ALWAYS returns
Boolean.class
.
init
public void init(Query q)
throws QueryParseException
- Init the expression. Sub-classes will often override this method.
This method just calls:
Expression.init(Query)
on the LHS and RHS (if present) of the
expression.
- Specified by:
init
in class Expression
- Parameters:
q
- The Query object.
- Throws:
QueryParseException
- If the LHS and/or RHS cannot be inited.
getValue
public Object getValue(Object o,
Query q)
throws QueryExecutionException
- Get the value of this expression. This will always return an instance of:
java.lang.Boolean
created as the result of a call to:
Expression.getValue(Object,Query)
.
- Specified by:
getValue
in class Expression
- Parameters:
o
- The object to evaluate the expression on.q
- The Query object.
- Returns:
- An instance of Boolean.
- Throws:
QueryExecutionException
- If the expression cannot be evaluated.
getRight
public Expression getRight()
- Get the RHS.
- Returns:
- The RHS of the expression.
getLeft
public Expression getLeft()
- Get the LHS.
- Returns:
- The LHS of the expression.
setLeft
public void setLeft(Expression exp)
setRight
public void setRight(Expression exp)
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2008 Gary Bentley. All Rights Reserved.