|
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.SmartCompareExpr
Compares a value to something else. This is the master class for several, type-constrained children. Idea is to have a key and to compare it with several values. The values are given as a string which is interpretated depending on the expected type of the value to be found. This master class only defines the general workflow. See the derived classes for datatype-aware operation.
| Nested Class Summary |
| Nested classes inherited from class biz.chitec.quarterback.util.logic.LogicExpr |
LogicExpr.Converter, LogicExpr.UniverseGenerator |
| Field Summary | |
private java.lang.String |
displaykey
|
protected java.lang.String |
key
|
protected java.util.List |
values
|
| Constructor Summary | |
protected |
SmartCompareExpr(java.lang.String keyx,
java.util.List valuesx)
|
protected |
SmartCompareExpr(java.lang.String keyx,
java.lang.String svaluesx)
|
| 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) |
boolean |
equals(java.lang.Object o)
|
boolean |
evaluate(java.lang.Object universe)
Is the expression valid in the given universe |
java.lang.String |
getDisplayKey()
|
java.lang.Object[] |
getInternalVars()
Only for GJSA class parsers: get class variables to create object from a parsed string. |
java.lang.String |
getKey()
|
int[] |
getResultSet(LogicExpr.UniverseGenerator generator)
Return all elements of the universe which match the expression |
java.util.List |
getValues()
|
java.lang.String |
getValuesString()
|
protected abstract java.lang.String |
internalToString(java.util.List internalvalues)
|
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. |
void |
setDisplayKey(java.lang.String displaykeyx)
|
void |
setValuesString(java.lang.String svaluesx)
|
protected abstract java.util.List |
stringToInternal(java.lang.String values)
|
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface biz.chitec.quarterback.util.logic.LogicExpr |
sqlString |
| Field Detail |
protected java.lang.String key
private java.lang.String displaykey
protected java.util.List values
| Constructor Detail |
protected SmartCompareExpr(java.lang.String keyx,
java.lang.String svaluesx)
protected SmartCompareExpr(java.lang.String keyx,
java.util.List valuesx)
| Method Detail |
public void setDisplayKey(java.lang.String displaykeyx)
public java.lang.String getDisplayKey()
public java.lang.String getKey()
public java.util.List getValues()
public java.lang.String getValuesString()
public void setValuesString(java.lang.String svaluesx)
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 void convertValues(LogicExpr.Converter c)
LogicExpr
convertValues in interface LogicExprpublic boolean evaluate(java.lang.Object universe)
LogicExpr
evaluate in interface LogicExprpublic java.lang.Object[] getInternalVars()
LogicExpr
getInternalVars in interface LogicExprpublic int[] getResultSet(LogicExpr.UniverseGenerator generator)
LogicExpr
getResultSet in interface LogicExprpublic boolean isReady()
LogicExpr
isReady in interface LogicExprpublic boolean isTreeReady()
LogicExpr
isTreeReady in interface LogicExprprotected abstract java.util.List stringToInternal(java.lang.String values)
protected abstract java.lang.String internalToString(java.util.List internalvalues)
|
QJCC homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||