koala.dynamicjava.tree
Class IfThenElseStatement

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Statement
          extended by koala.dynamicjava.tree.IfThenStatement
              extended by koala.dynamicjava.tree.IfThenElseStatement
All Implemented Interfaces:
SourceInfo.Wrapper

public class IfThenElseStatement
extends IfThenStatement

This class represents the if-then-else statement nodes of the syntax tree

Version:
1.0 - 1999/05/16
Author:
Stephane Hillion

Constructor Summary
IfThenElseStatement(Expression cond, Node tstmt, Node estmt)
          Creates a new while statement
IfThenElseStatement(Expression cond, Node tstmt, Node estmt, SourceInfo si)
          Creates a new while statement
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Node getElseStatement()
          Returns the else statement of this statement
 void setElseStatement(Node node)
          Sets the else statement of this statement
 java.lang.String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.IfThenStatement
getCondition, getThenStatement, setCondition, setThenStatement
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfThenElseStatement

public IfThenElseStatement(Expression cond,
                           Node tstmt,
                           Node estmt)
Creates a new while statement

Parameters:
cond - the condition
tstmt - the then statement
estmt - the else statement
Throws:
java.lang.IllegalArgumentException - if cond is null or tstmt is null or estmt is null

IfThenElseStatement

public IfThenElseStatement(Expression cond,
                           Node tstmt,
                           Node estmt,
                           SourceInfo si)
Creates a new while statement

Parameters:
cond - the condition
tstmt - the then statement
estmt - the else statement
Throws:
java.lang.IllegalArgumentException - if cond is null or tstmt is null or estmt is null
Method Detail

getElseStatement

public Node getElseStatement()
Returns the else statement of this statement


setElseStatement

public void setElseStatement(Node node)
Sets the else statement of this statement

Throws:
java.lang.IllegalArgumentException - if node is null

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Overrides:
acceptVisitor in class IfThenStatement
Parameters:
visitor - the visitor to accept

toString

public java.lang.String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class IfThenStatement