Rule Execution Server API

ilog.rules.factory
Class IlrIfStatement

java.lang.Object
  extended by ilog.rules.factory.IlrBaseStatement
      extended by ilog.rules.factory.IlrStatementBlock
          extended by ilog.rules.factory.IlrIfStatement
All Implemented Interfaces:
ilog.rules.factory.IlrSourceElement, IlrStatement, Serializable

public final class IlrIfStatement
extends IlrStatementBlock

This class represents an if statement of the rule language.

Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of IBM Decision Server.

See Also:
Serialized Form

Nested Class Summary
static class IlrIfStatement.ElseBlock
          This class represents the else part of an if statement.
 
Constructor Summary
IlrIfStatement(IlrTest test, IlrStatement[] statements)
          Constructs an if statement containing only an if statement block.
IlrIfStatement(IlrTest test, IlrStatement[] statements, IlrIfStatement.ElseBlock elseBlock)
          Constructs an if statement containing initially the an if block and an else block.
 
Method Summary
 Object exploreStatement(IlrFactoryExplorer explorer)
          This method explores the if statement using a factory explorer.
 IlrIfStatement.ElseBlock getElseBlock()
          Returns the else block of this statement.
 IlrTest getTest()
          Returns the test of this statement.
 String toString()
           
 
Methods inherited from class ilog.rules.factory.IlrStatementBlock
addStatement, enumerateStatements, getStatementCount, getStatements, removeStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlrIfStatement

public IlrIfStatement(IlrTest test,
                      IlrStatement[] statements)
Constructs an if statement containing only an if statement block. There is no else part attached to the statement.

Parameters:
test - The test to perform.
statements - The statements to execute when the test is true. This parameter can be null. In this case, it represents an empty block.

IlrIfStatement

public IlrIfStatement(IlrTest test,
                      IlrStatement[] statements,
                      IlrIfStatement.ElseBlock elseBlock)
Constructs an if statement containing initially the an if block and an else block.

Parameters:
test - The test to perform.
statements - The statements to execute when the test is true. This parameter can be null. In this case, it represents an empty block.
elseBlock - The statements to execute when the test is false. A null parameter denotes the absence of the else block.
Method Detail

getTest

public IlrTest getTest()
Returns the test of this statement.

Returns:
An IlrTest representing the test.

getElseBlock

public IlrIfStatement.ElseBlock getElseBlock()
Returns the else block of this statement.

Returns:
An ElseBlock representing the else block, or null if there is no else block.

exploreStatement

public Object exploreStatement(IlrFactoryExplorer explorer)
This method explores the if statement using a factory explorer.

Parameters:
explorer - The factory explorer.
Returns:
An object, the result of the exploration, or null if the method does not return a value.

toString

public String toString()
Overrides:
toString in class Object

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013