ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.rules
Class AbleForLoopRule

java.lang.Object
  |
  +--com.ibm.able.rules.AbleRule
        |
        +--com.ibm.able.rules.AbleForLoopRule
All Implemented Interfaces:
AbleIterationRule, java.io.Serializable

public class AbleForLoopRule
extends AbleRule
implements AbleIterationRule, java.io.Serializable

This class represents a for-loop "iteration" rule consisting of an initializer expression, a conditional test expression, and an increment expression. The conditional test expression is tested at the top of the loop. The semantics are the same as a Java for( ; ; ) statement

See Also:
Serialized Form

Field Summary
protected  java.util.Vector myConsequents
          myConsequents is a list of consequent clauses (AbleConsequentClause objects), the body of the for-loop.
protected  java.util.Vector myInitialExpressionList
          myInitialExpressionList is an assignment expression used to set the initiali value of the loop variable
protected  java.util.Vector myIteratorExpressionList
          myIteratorExpressionList is an assignment expression used to increment the loop variable
protected  AbleExpression myTestExpression
          myTestExpression is a boolean expression.
 
Fields inherited from class com.ibm.able.rules.AbleRule
myBooleanTruth, myBreakpoint, myComment, myEnabled, myFiredCount, myFiredFlag, myId, myLabel, myLocation, myPreConditions, myPriority, myPrompt, myRdRefs, myRuleSet, myTemplateFlag, myTemplateName, myTemplateValues, myWrRefs, PriorityDefault, RuleIdInitial
 
Constructor Summary
AbleForLoopRule(java.lang.String theLabel, AbleRd thePriority, java.util.Vector theInitialExpressionList, AbleExpression theTestExpression, java.util.Vector theIteratorExpressionList, java.util.Vector theConsequents)
          Create a new conditional rule with the specified priority, antecedent clauses, and consequent clause.
 
Method Summary
 java.lang.String arlString()
          Return a formal Able Rule Language (ARL) String.
 java.util.Vector getDoActions()
          Retrieve the rule's list of "do" action (AbleConsequent) clauses.
 java.util.Vector getInitialExpressionList()
           
 java.util.Vector getIteratorExpressionList()
           
 int getNumberOfDoActions()
          Retrieve the number of "do" actions in this rule.
 java.lang.String getTemplateString(java.util.Vector theTemplateVars)
          Retrieve a text format string for use by rule templates.
 AbleExpression getTestExpression()
          Retrieve the rule's test expression.
 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 xmlString()
          Return a formal XML string.
 
Methods inherited from class com.ibm.able.rules.AbleRule
addHeaderRdReferences, addRdReference, addRdReferences, addWrReference, addWrReferences, arlPreConditionsString, checkTimePeriodPreConditions, clearBreakpoint, Copyright, getArlComment, getBooleanTruth, getBreakpoint, getComment, getId, getIdLabelString, getLabel, getLocation, getPriority, getPrompt, getPromptString, getRdReferences, getTemplateHeaderString, getTemplateName, getTemplateValues, getTemplateVars, getWrReferences, isEnabled, isFired, isGeneratedFromTemplate, isTemplate, logTrace, reset, setBooleanTruth, setBreakpoint, setComment, setEnabled, setFired, setId, setLocation, setPreConditions, setPriority, setPrompt, setTemplate, setTemplateName, setTemplateValues, xmlPreConditionsString, xmlPriorityString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myInitialExpressionList

protected java.util.Vector myInitialExpressionList
myInitialExpressionList is an assignment expression used to set the initiali value of the loop variable

myTestExpression

protected AbleExpression myTestExpression
myTestExpression is a boolean expression.

myIteratorExpressionList

protected java.util.Vector myIteratorExpressionList
myIteratorExpressionList is an assignment expression used to increment the loop variable

myConsequents

protected java.util.Vector myConsequents
myConsequents is a list of consequent clauses (AbleConsequentClause objects), the body of the for-loop.
Constructor Detail

AbleForLoopRule

public AbleForLoopRule(java.lang.String theLabel,
                       AbleRd thePriority,
                       java.util.Vector theInitialExpressionList,
                       AbleExpression theTestExpression,
                       java.util.Vector theIteratorExpressionList,
                       java.util.Vector theConsequents)
Create a new conditional rule with the specified priority, antecedent clauses, and consequent clause.
Parameters:
theLabel - The unique label, or name, of this rule.

thePriority - The priority of this rule.

theInitialExpressionList - A list of AbleExpressions used to initialize the loop variable

theTestExpression - An AbleExpression used to test the loop variable. It must be a boolean expression.

theIteratorExpressionList - A list of AbleExpressions used to increment the loop variable.

theConsequents - A list of AbleConsequentClause objects that define the consequents of this rule. The list is cloned.

*

Method Detail

getInitialExpressionList

public java.util.Vector getInitialExpressionList()

getTestExpression

public AbleExpression getTestExpression()
Description copied from interface: AbleIterationRule
Retrieve the rule's test expression.
Specified by:
getTestExpression in interface AbleIterationRule
Following copied from interface: com.ibm.able.rules.AbleIterationRule
Returns:
A Boolean test expression associated with this rule.

getIteratorExpressionList

public java.util.Vector getIteratorExpressionList()

getNumberOfDoActions

public int getNumberOfDoActions()
Retrieve the number of "do" actions in this rule.
Specified by:
getNumberOfDoActions in interface AbleIterationRule
Returns:
The number of "do" actions.

getDoActions

public final java.util.Vector getDoActions()
Retrieve the rule's list of "do" action (AbleConsequent) clauses.
Specified by:
getDoActions in interface AbleIterationRule
Returns:
A reference to the actual list of do action clauses. This list may not be empty.

arlString

public java.lang.String arlString()
Return a formal Able Rule Language (ARL) String.
Overrides:
arlString in class AbleRule
Returns:
A String describing the object in Able rule language.

xmlString

public java.lang.String xmlString()
Return a formal XML string.
Overrides:
xmlString in class AbleRule
Returns:
A String describing the object in XML.

getTemplateString

public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
                                   throws AbleDataException
Retrieve a text format string for use by rule templates. The string contains "{n}" strings, where the index 'n' corresponds to the template variables defined in the rule template. This string is based on the standard arlString() representation of the rule. After replacement of the template variable values, the resulting string must be a valid ARL format string that can be parsed.
Overrides:
getTemplateString in class AbleRule
Parameters:
theTemplateVars - An ordered list of template variables referenced by this rule.
Returns:
A Text format string used to create a new rule instance.
See Also:
AbleRuleTemplate

toString

public java.lang.String toString()
Retrieve a string describing (the contents of) the object.
Overrides:
toString in class AbleRule
Returns:
A String containing the current contents of the object.

traceString

public java.lang.String traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object.
Overrides:
traceString in class AbleRule
Parameters:
theFlavor - An Able.TraceStringFlavor value.

Returns:
A String containing the current contents of the object.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003