koala.dynamicjava.tree
Class SwitchBlock

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.SwitchBlock
All Implemented Interfaces:
ExpressionContainer, SourceInfo.Wrapper

public class SwitchBlock
extends Node
implements ExpressionContainer

This class represents the switch expression-statement bindings

Version:
1.0 - 1999/06/30
Author:
Stephane Hillion

Field Summary
 
Fields inherited from interface koala.dynamicjava.tree.ExpressionContainer
EXPRESSION
 
Constructor Summary
SwitchBlock(Expression exp, List<Node> stmts)
          Creates a new binding
SwitchBlock(Expression exp, List<Node> stmts, SourceInfo si)
          Creates a new binding
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Expression getExpression()
          Returns the 'case' expression
 List<Node> getStatements()
          Returns the statements
 void setExpression(Expression e)
          Sets the 'case' expression
 void setStatements(List<Node> l)
          Sets the statements
 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

SwitchBlock

public SwitchBlock(Expression exp,
                   List<Node> stmts)
Creates a new binding


SwitchBlock

public SwitchBlock(Expression exp,
                   List<Node> stmts,
                   SourceInfo si)
Creates a new binding

Parameters:
exp - the case expression, or null for a default block
stmts - the body
Method Detail

getExpression

public Expression getExpression()
Returns the 'case' expression

Specified by:
getExpression in interface ExpressionContainer

setExpression

public void setExpression(Expression e)
Sets the 'case' expression

Specified by:
setExpression in interface ExpressionContainer

getStatements

public List<Node> getStatements()
Returns the statements


setStatements

public void setStatements(List<Node> l)
Sets the statements


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