koala.dynamicjava.tree
Class SwitchStatement

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

public class SwitchStatement
extends Statement

This class represents the switch statement nodes of the syntax tree

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

Constructor Summary
SwitchStatement(Expression sel, java.util.List<SwitchBlock> cases, SourceInfo si)
          Creates a new switch statement
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 java.util.List<SwitchBlock> getBindings()
          Returns the 'case' bindings
 Expression getSelector()
          Gets the selector
 void setBindings(java.util.List<SwitchBlock> l)
          Sets the bindings
 void setSelector(Expression e)
          Sets the selector
 java.lang.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

SwitchStatement

public SwitchStatement(Expression sel,
                       java.util.List<SwitchBlock> cases,
                       SourceInfo si)
Creates a new switch statement

Parameters:
sel - the selector
cases - the case bindings (SwitchBlocks)
Throws:
java.lang.IllegalArgumentException - if sel is null or cases is null
Method Detail

getSelector

public Expression getSelector()
Gets the selector


setSelector

public void setSelector(Expression e)
Sets the selector

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

getBindings

public java.util.List<SwitchBlock> getBindings()
Returns the 'case' bindings


setBindings

public void setBindings(java.util.List<SwitchBlock> l)
Sets the bindings

Throws:
java.lang.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 java.lang.String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class java.lang.Object