|
QJCC homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.chitec.quarterback.util.logic.ArithmeticExpr
Base for logical expressions which work as arithmetic comparators
Keeps helper classes and defines the overall workflow for the different arithmetic checks.
| Nested Class Summary |
| Nested classes inherited from class biz.chitec.quarterback.util.logic.LogicExpr |
LogicExpr.Converter, LogicExpr.UniverseGenerator |
| Field Summary | |
protected java.lang.Object |
key
|
protected static NumberComparator |
numbercomparator
|
protected java.lang.Comparable |
value
|
| Constructor Summary | |
protected |
ArithmeticExpr(java.lang.Object kx,
java.lang.Comparable vx)
|
protected |
ArithmeticExpr(java.lang.Object kx,
double vx)
|
protected |
ArithmeticExpr(java.lang.Object kx,
int vx)
|
| Method Summary | |
java.lang.Object |
clone()
Deep-copy the logic expression. |
void |
convertValues(LogicExpr.Converter c)
Conversion of values in the expressions (e.g. for replacing external representations of database entries with their internal key) |
protected abstract boolean |
doCompare(int universevalue)
|
protected abstract boolean |
doEvaluate(java.lang.Comparable universevalue)
|
boolean |
equals(java.lang.Object o)
|
boolean |
evaluate(java.lang.Object universe)
Is the expression valid in the given universe |
java.lang.Object[] |
getInternalVars()
Only for GJSA class parsers: get class variables to create object from a parsed string. |
int[] |
getResultSet(LogicExpr.UniverseGenerator generator)
Return all elements of the universe which match the expression |
protected abstract java.lang.String |
getSQLComparatorSign()
|
java.lang.Object |
getValue()
|
boolean |
isReady()
Returns if the expression is actually evaluable, i.e. any of the evaluating methods can be called. |
boolean |
isTreeReady()
Returns whether this and all deeper expressions are evaluable. |
java.lang.String |
sqlString(java.util.Map identifiers)
Returns an SQL representation of the expression with the constant names replaced by the ones in the given Map. |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static transient NumberComparator numbercomparator
protected java.lang.Object key
protected java.lang.Comparable value
| Constructor Detail |
protected ArithmeticExpr(java.lang.Object kx,
java.lang.Comparable vx)
protected ArithmeticExpr(java.lang.Object kx,
int vx)
protected ArithmeticExpr(java.lang.Object kx,
double vx)
| Method Detail |
protected abstract boolean doEvaluate(java.lang.Comparable universevalue)
protected abstract boolean doCompare(int universevalue)
protected abstract java.lang.String getSQLComparatorSign()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
LogicExprNote: This method must be defined in a way that makes it quite complicated to call it for simply cloning a logic expression tree: It returns an Object (which always happens to be a LogicExpr) and it might throw a CloneNotSupportedException - which will (a) never happen and is (b) no RuntimeException, so a caller would always have to catch it.
To make life simpler, there is a static method LogicExprUtilties.cloneLogicExpr() which will call clone() on the root object and take care of return value and exceptions.
clone in interface LogicExprjava.lang.CloneNotSupportedExceptionpublic boolean equals(java.lang.Object o)
public boolean isReady()
LogicExpr
isReady in interface LogicExprpublic boolean isTreeReady()
LogicExpr
isTreeReady in interface LogicExprpublic final boolean evaluate(java.lang.Object universe)
evaluate in interface LogicExprpublic int[] getResultSet(LogicExpr.UniverseGenerator generator)
LogicExpr
getResultSet in interface LogicExprpublic java.lang.String sqlString(java.util.Map identifiers)
LogicExpr
sqlString in interface LogicExprpublic java.lang.Object[] getInternalVars()
LogicExpr
getInternalVars in interface LogicExprpublic java.lang.Object getValue()
public void convertValues(LogicExpr.Converter c)
LogicExpr
convertValues in interface LogicExpr
|
QJCC homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||