|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.data.AbleLiteral
com.ibm.able.rules.AbleIfThenElseStatement
This class holds the expressions and actions used in an if-then-else action (which could be nested in other rules or actions). The antecedent expression can be an arbitrarily complex boolean expression and the then{} and else{} sections can contain one or more consequent (action) clauses.
| Field Summary | |
|---|---|
protected AbleExpression |
myAntecedent
myAntecedent is an AbleExpression that evaluates to a boolean value. |
protected java.util.Vector |
myElseActions
myElseActions is a list of AbleConsequentClause objects. |
protected AbleRuleBlock |
myRuleBlock
|
protected AbleRuleSet |
myRuleSet
|
protected java.util.Vector |
myThenActions
myThenActions is a list of AbleConsequentClause objects. |
| Constructor Summary | |
|---|---|
AbleIfThenElseStatement(AbleRuleSet theRuleSet,
AbleRuleBlock theRuleBlock,
AbleExpression theAntecedent)
Create a new if/then/else statement with the specified condition and no actions. |
|
AbleIfThenElseStatement(AbleRuleSet theRuleSet,
AbleRuleBlock theRuleBlock,
AbleExpression theAntecedent,
java.util.Vector theThenActions,
java.util.Vector theElseActions)
Create a new if/then/else statement with the specified condition and actions. |
|
| Method Summary | |
|---|---|
void |
addElseAction(AbleConsequentClause theAction)
|
void |
addThenAction(AbleConsequentClause theAction)
|
java.lang.String |
arlCRdString()
Return a formal ARL "clause read" string that describes this data object. |
java.lang.String |
arlString()
Return a formal Able Rule Language (ARL) String. |
java.lang.String |
armlString()
Return a formal XML string. |
protected void |
evalConsequentClause(AbleConsequentClause theClause)
Evaluate the specified consequent clause. |
AbleExpression |
getAntecedent()
Retrieve the rule's list of antecedent clauses. |
boolean |
getBooleanValue()
Retrieve the value of this data object as a boolean value. |
int |
getDataType()
Retrieve the data type of this data object. |
java.lang.Class |
getDataTypeClass()
Retrieve the actual class of this object's underlying data type. |
java.lang.String |
getDataTypeClassName()
Retrieve the name of the class of this object's underlying data type. |
java.util.Vector |
getElseActions()
Retrieve the rule's list of else clauses. |
AbleFuzzySet |
getFuzzyValue()
Retrieve the value of this data object as a fuzzy value. |
java.lang.Object |
getGenericValue()
Retrieve the value of this data object as an Object. |
double |
getNumericValue()
Retrieve the value of this data object as a numeric value. |
java.lang.String |
getStringValue()
Retrieve the value of this data object as a string value. |
java.lang.String |
getTemplateString(java.util.Vector theTemplateVars)
Retrieve a text format string for use by rule templates. |
java.util.Vector |
getThenActions()
Retrieve the rule's list of consequent clauses. |
AbleLiteral |
getValue()
Retrieve the value of this data object as a literal. |
long |
numberOfElseClauses()
Retrieve the number of else clauses in this rule. |
long |
numberOfThenClauses()
Retrieve the number of consequent clauses in this rule. |
void |
setElseActions(java.util.Vector theElseActions)
|
void |
setThenActions(java.util.Vector theThenActions)
|
java.lang.String |
toString()
Retrieve a string describing (the contents of) the object. |
java.lang.String |
traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object. |
java.lang.String |
xmlCRdString()
Return a formal XML "clause read" string that describes this data object. |
java.lang.String |
xmlString()
Return a formal XML string. |
| Methods inherited from class com.ibm.able.data.AbleLiteral |
|---|
bitwiseAND, bitwiseNOT, bitwiseOR, bitwiseShiftLeft, bitwiseShiftRight, bitwiseShiftRightZeroFill, bitwiseXOR, cmpEq, cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, cmpNeq, compDivide, compMinus, compModulo, compMultiply, compPlus, compUnaryMinus, getDataTypeAsString, getReferent, getReferents, isConstant, logicalAND, logicalNOT, logicalOR |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected AbleExpression myAntecedent
protected java.util.Vector myThenActions
protected java.util.Vector myElseActions
protected AbleRuleSet myRuleSet
protected AbleRuleBlock myRuleBlock
| Constructor Detail |
public AbleIfThenElseStatement(AbleRuleSet theRuleSet,
AbleRuleBlock theRuleBlock,
AbleExpression theAntecedent,
java.util.Vector theThenActions,
java.util.Vector theElseActions)
theRuleSet - The ruleset to provide the context for the new statement.theRuleBlock - The ruleblock to insert the new statement.theAntecedent - An AbleExpression that defines the
antecedent for this statement.
theThenActions - A list of assignment statements that define the
consequents of this rule. The list must contain
at least one AbleConsequentClause.
The list is cloned.
theElseActions - A list of assignment statements that define the
actions to perform when the antecedents fail.
The list may be empty, but it must not be null.
The list is cloned.
public AbleIfThenElseStatement(AbleRuleSet theRuleSet,
AbleRuleBlock theRuleBlock,
AbleExpression theAntecedent)
theRuleSet - The ruleset to provide the context for the new statement.theRuleBlock - The ruleblock to insert the new statement.theAntecedent - An AbleExpression that defines the
antecedent for this statement| Method Detail |
public void addThenAction(AbleConsequentClause theAction)
public void addElseAction(AbleConsequentClause theAction)
public final AbleExpression getAntecedent()
public final java.util.Vector getThenActions()
public void setThenActions(java.util.Vector theThenActions)
public long numberOfThenClauses()
public final java.util.Vector getElseActions()
public void setElseActions(java.util.Vector theElseActions)
public long numberOfElseClauses()
public java.lang.String arlString()
public java.lang.String xmlString()
public java.lang.String armlString()
public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
getTemplateString in interface AbleRdgetTemplateString in class AbleLiteraltheTemplateVars - An ordered list of template variables referenced by this rule.
AbleRuleTemplatepublic java.lang.String toString()
toString in class AbleLiteralpublic java.lang.String traceString(int theTraceStringFlavor)
traceString in interface AbleRdtraceString in class AbleLiteraltheTraceStringFlavor - An Able.TraceStringFlavor value.
public AbleLiteral getValue()
throws AbleDataException
getValue in interface AbleRdgetValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a literal.
protected void evalConsequentClause(AbleConsequentClause theClause)
throws AbleDataException
theClause - a consequent clause to evaluate.
AbleDataException - when the clause's data objects are incompatible, or
when the relational operator is invalid for the
current situation or unrecognized.public java.lang.Class getDataTypeClass()
AbleLiteral
getDataTypeClass in interface AbleRdgetDataTypeClass in class AbleLiteralpublic java.lang.String getDataTypeClassName()
AbleLiteral
getDataTypeClassName in interface AbleRdgetDataTypeClassName in class AbleLiteralpublic java.lang.String arlCRdString()
arlCRdString in interface AbleRdarlCRdString in class AbleLiteral
public boolean getBooleanValue()
throws AbleDataException
AbleLiteral
getBooleanValue in interface AbleRdgetBooleanValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a boolean value.
public AbleFuzzySet getFuzzyValue()
throws AbleDataException
AbleLiteral
getFuzzyValue in interface AbleRdgetFuzzyValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a fuzzy value.
public java.lang.Object getGenericValue()
throws AbleDataException
AbleLiteral
getGenericValue in interface AbleRdgetGenericValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
an Object.
public double getNumericValue()
throws AbleDataException
AbleLiteral
getNumericValue in interface AbleRdgetNumericValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a numeric value.
public java.lang.String getStringValue()
throws AbleDataException
AbleLiteral
getStringValue in interface AbleRdgetStringValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a string value.public java.lang.String xmlCRdString()
AbleLiteral
xmlCRdString in interface AbleRdxmlCRdString in class AbleLiteralpublic int getDataType()
AbleLiteral
getDataType in interface AbleRdgetDataType in class AbleLiteralAbleRd.getDataType()
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||