public abstract class Script_Conditions extends Script_Element
The function variable itself defines the evaluation requirement. This can be
a boolean result or a mathematical comparison. The String-based representation is of
the form method_name:operator, where the method name is the key name to the method
to use, from the Script_Model.Reflection section. For a boolean evaluation,
set the comparison operator to Boolean.TRUE or FALSE. For a
mathematical comparison, set the operator to AiHeuristicConst.EQ,
GT, LE and so on. The evaluation is then carried out as:
Use source.method to evaluate input and compare as
true with filter based on the operator.
If any value is null then it is simply not added to the script and so the
function set can be used simply to define a single variable, for example.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
filter
A filter applied to the method result
|
protected org.ai_heuristic.eval.Condition |
function
Additional evaluation function on the method result or filter.
|
protected java.lang.String |
operation
The operation or method to invoke
|
protected java.lang.String |
source
The source variable to execute the function on
|
id, internalID, keyLong, name, namespace, objType, parentElement, value| Constructor and Description |
|---|
Script_Conditions(org.licas_xml.abs.Element autoXml)
Create a new instance of Script_Conditions and add the xml-based description of the
element values.
|
Script_Conditions(java.lang.String scriptType,
java.lang.String elemID)
Create a new instance of Script_Conditions.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFilter()
Get the output filter.
|
org.ai_heuristic.eval.Condition |
getFunction()
Get the comparison function.
|
java.lang.String |
getOperation()
Get the operation to be invoked.
|
java.lang.String |
getSource()
Get the source id.
|
void |
setFilter(java.lang.String theFilter)
Set the filter on the operation result.
|
void |
setFunction(org.ai_heuristic.eval.Condition theFunction)
Set the function that evaluates the result further.
|
void |
setOperation(java.lang.String thisOperation)
Set the operation to be invoked.
|
void |
setSource(java.lang.String theSource)
Set the source to execute the function on.
|
org.licas_xml.abs.Element |
toXml()
Convert the contents of this Script_Element into an XML-only format.
|
getID, getInternalID, getName, getNamespace, getObjType, getParent, getScriptUuid, getValue, processThis, setForUse, setNamespace, setObjType, setParent, setValue, setValue, usesSubEventsprotected java.lang.String operation
protected java.lang.String filter
protected org.ai_heuristic.eval.Condition function
'true' or exists, or can be math comparison.protected java.lang.String source
public Script_Conditions(java.lang.String scriptType,
java.lang.String elemID)
scriptType - the script element type. This is also the element tag name
and should not be null.elemID - this is the external id used to identify this element specifically. The
element is also stored under this value and so it cannot be null.public Script_Conditions(org.licas_xml.abs.Element autoXml)
throws java.lang.Exception
autoXml - the xml-based description of values to add.java.lang.Exception - any error.public void setOperation(java.lang.String thisOperation)
thisOperation - the operation name.public java.lang.String getOperation()
public void setFilter(java.lang.String theFilter)
theFilter - a filter (query, for example) to apply on the operation result.public java.lang.String getFilter()
public void setFunction(org.ai_heuristic.eval.Condition theFunction)
theFunction - the comparison function.public org.ai_heuristic.eval.Condition getFunction()
public void setSource(java.lang.String theSource)
theSource - the function source.public java.lang.String getSource()
public org.licas_xml.abs.Element toXml()
throws java.lang.Exception
toXml in class Script_Elementjava.lang.Exception - any error.