ilog.rules.brl.translation

Class IlrRuleStatement

  • All Implemented Interfaces:
    java.io.Serializable


    public class IlrRuleStatement
    extends IlrStatement
    Represents the structure of a rule, as it will be generated in code.

    It contains a:

    • List of header statements
    • List of condition statements
    • List of action statements
    • List of else action statements
    • Single evaluate statement

    See Also:
    Serialized Form
    • Constructor Detail

      • IlrRuleStatement

        public IlrRuleStatement(IlrSyntaxTree.Node node)
        Builds a new IlrRuleStatement for the specified node.
        Parameters:
        node - The node.
    • Method Detail

      • makeNewAnonymousVariableName

        public java.lang.String makeNewAnonymousVariableName()
        Creates a new anonymous variable name for this unit. This method ensures that the returned variable name is not already used.
      • getNamedStatement

        public IlrNamedStatement getNamedStatement(java.lang.String name)
        Gets the named statement contained in the rule statement, corresponding to the specified name.
        Parameters:
        name - The name.
        Returns:
        The named statement found for this name.
      • getStatement

        public IlrStatement getStatement(IlrSyntaxTree.Node node)
        Gets the statement contained in this rule statement, corresponding to the specified node.
        Parameters:
        node - The syntax tree node.
        Returns:
        The statement found for this node.
      • getHeaderStatements

        public java.util.List getHeaderStatements()
        Returns the list of header statements of this rule statement. Note: Do not modify this list directly. To add a new header statement, use addHeaderStatement(IlrHeaderStatement).
        Returns:
        The list of header statements.
      • getHeaderStatement

        public IlrHeaderStatement getHeaderStatement(int index)
        Gets the header statement at index index.
        Returns:
        The header statement at index index.
      • addHeaderStatement

        public void addHeaderStatement(IlrHeaderStatement header)
        Adds a new header statement at the end of the list of header statements. If this rule statement already contains this header, then this method does nothing.
        Parameters:
        header - The header statement to add.
      • addHeaderStatement

        public void addHeaderStatement(int index,
                              IlrHeaderStatement header)
        Adds a new header statement at index index. If this rule statement already contains this header, then this method does nothing.
        Parameters:
        index - The insertion index.
        header - The header statement to add.
      • getConditionStatement

        public IlrConditionStatement getConditionStatement(int index)
        Gets the condition statement at index index.
        Parameters:
        index - The index of the condition statement.
      • addConditionStatement

        public void addConditionStatement(IlrConditionStatement condition)
        Adds a new condition statement. If this rule statement already contains this condition statement, then this method does nothing.
        Parameters:
        condition - The condition statement to add.
      • addConditionStatementAt

        public void addConditionStatementAt(int index,
                                   IlrConditionStatement condition)
        Adds a new condition statement at index index. If this rule statement already contains this condition, then this method does nothing.
        Parameters:
        index - The insertion index.
        condition - The condition statement to add.
      • setEvaluateStatement

        public void setEvaluateStatement(IlrEvaluateStatement evaluate)
        Sets the evaluate statement of this rule statement.
        Parameters:
        evaluate - The evaluate statement.
      • getEvaluateStatement

        public IlrEvaluateStatement getEvaluateStatement()
        Gets the evaluate statement of this rule statement.
        Returns:
        The evaluate statement.
      • getActionStatement

        public IlrActionStatement getActionStatement(int index)
        Gets the action statement at index index.
        Parameters:
        index - The index.
        Returns:
        The action statement at this index.
      • getElseActionStatement

        public IlrActionStatement getElseActionStatement(int index)
        Gets the else action statement at index index.
        Parameters:
        index - The index.
        Returns:
        The action statement at this index.
      • addActionStatement

        public void addActionStatement(IlrActionStatement action)
        Adds a new action statement.
        Parameters:
        action - The action statement.
      • addActionStatement

        public void addActionStatement(int index,
                              IlrActionStatement action)
        Adds an action statement at index index.
        Parameters:
        index - The insertion index.
        action - The action.
      • addElseActionStatement

        public void addElseActionStatement(int index,
                                  IlrActionStatement action)
        Adds an else action statement at index index.
        Parameters:
        index - The insertion index.
        action - The action.

© Copyright IBM Corp. 1987, 2017