koala.dynamicjava.tree
Class ConditionalExpression

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Expression
          extended by koala.dynamicjava.tree.ConditionalExpression
All Implemented Interfaces:
SourceInfo.Wrapper

public class ConditionalExpression
extends Expression

This class represents the binary expression nodes of the syntax tree

Version:
1.0 - 1999/04/25
Author:
Stephane Hillion

Constructor Summary
ConditionalExpression(Expression cexp, Expression texp, Expression fexp)
          Initializes the expression
ConditionalExpression(Expression cexp, Expression texp, Expression fexp, SourceInfo si)
          Initializes the expression
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Expression getConditionExpression()
          Returns the condition expression
 Expression getIfFalseExpression()
          Returns the if false expression
 Expression getIfTrueExpression()
          Returns the if true expression
 void setConditionExpression(Expression e)
          Sets the condition expression
 void setIfFalseExpression(Expression e)
          Sets the if false expression
 void setIfTrueExpression(Expression e)
          Sets the if true expression
 String toString()
          Implementation of toString for use in unit testing
 
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

ConditionalExpression

public ConditionalExpression(Expression cexp,
                             Expression texp,
                             Expression fexp)
Initializes the expression

Parameters:
cexp - the condition expression
texp - the if true expression
fexp - the if false expression
Throws:
IllegalArgumentException - if cexp is null or texp is null or fexp is null

ConditionalExpression

public ConditionalExpression(Expression cexp,
                             Expression texp,
                             Expression fexp,
                             SourceInfo si)
Initializes the expression

Parameters:
cexp - the condition expression
texp - the if true expression
fexp - the if false expression
Throws:
IllegalArgumentException - if cexp is null or texp is null or fexp is null
Method Detail

getConditionExpression

public Expression getConditionExpression()
Returns the condition expression


setConditionExpression

public void setConditionExpression(Expression e)
Sets the condition expression

Throws:
IllegalArgumentException - if e is null

getIfTrueExpression

public Expression getIfTrueExpression()
Returns the if true expression


setIfTrueExpression

public void setIfTrueExpression(Expression e)
Sets the if true expression

Throws:
IllegalArgumentException - if e is null

getIfFalseExpression

public Expression getIfFalseExpression()
Returns the if false expression


setIfFalseExpression

public void setIfFalseExpression(Expression e)
Sets the if false expression

Throws:
IllegalArgumentException - if e is null

acceptVisitor

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

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

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

Overrides:
toString in class Object