ILOG JRules

ilog.rules.brl.translation
Class IlrBlockActionStatement

java.lang.Object
  extended by ilog.rules.brl.translation.IlrStatement
      extended by ilog.rules.brl.translation.IlrActionStatement
          extended by ilog.rules.brl.translation.IlrBlockActionStatement
All Implemented Interfaces:
IlrNamedStatement, Serializable

public class IlrBlockActionStatement
extends IlrActionStatement

Defines actions that can contain other actions. The only predefined block action kind is the for each loop.

If you want to add a new kind of block action, use a kind starting from constant CUSTOM_EXTENSION.

See Also:
Serialized Form

Field Summary
static int CUSTOM_EXTENSION
          Constant for extending the kind of block statements (value is 10).
static int FOR_EACH
          Constant for the for each loop action statement (value is 0).
 
Constructor Summary
IlrBlockActionStatement(IlrSyntaxTree.Node node)
          Creates a new block statement with a given Abstract Syntax Tree node.
 
Method Summary
 void accept(IlrIntermediateForm.Visitor visitor)
          Accepts a visitor.
 int actionsCount()
          Returns the number of action statements contained in this block action.
 void addAction(IlrActionStatement action)
          Adds an IlrActionStatement to this block action.
 IlrActionStatement getAction(int index)
          Gets the action statement stored at index i.
 int getKind()
          Gets the kind of this block action statement.
 void setKind(int kind)
          Sets the kind of this block action statement.
 
Methods inherited from class ilog.rules.brl.translation.IlrActionStatement
getConcept, getParent, getVarName, setConcept, setVarName
 
Methods inherited from class ilog.rules.brl.translation.IlrStatement
getNode, hasTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOR_EACH

public static final int FOR_EACH
Constant for the for each loop action statement (value is 0).

See Also:
Constant Field Values

CUSTOM_EXTENSION

public static final int CUSTOM_EXTENSION
Constant for extending the kind of block statements (value is 10).

See Also:
Constant Field Values
Constructor Detail

IlrBlockActionStatement

public IlrBlockActionStatement(IlrSyntaxTree.Node node)
Creates a new block statement with a given Abstract Syntax Tree node.

Parameters:
node - The Abstract Syntax Tree node.
Method Detail

accept

public void accept(IlrIntermediateForm.Visitor visitor)
Accepts a visitor.

Specified by:
accept in class IlrStatement
Parameters:
visitor - The visitor.

addAction

public void addAction(IlrActionStatement action)
Adds an IlrActionStatement to this block action.

Parameters:
action - The action statement.

getAction

public IlrActionStatement getAction(int index)
Gets the action statement stored at index i.

Parameters:
index - The index.
Returns:
The action statement at index i, or null.

actionsCount

public int actionsCount()
Returns the number of action statements contained in this block action.

Returns:
The number of action statements contained in this block action.

setKind

public void setKind(int kind)
Sets the kind of this block action statement.

Parameters:
kind - The kind of block action statement.

getKind

public int getKind()
Gets the kind of this block action statement.

Returns:
The kind of this block action statement.

ILOG JRules