public class SwitchStatement extends Statement
| Constructor and Description |
|---|
SwitchStatement(Expression value)
Creates a new switch statement with the specified expression.
|
SwitchStatement(Expression value,
CompoundStatement stmt)
Constructs a new switch statement with the specified value expression and
the body statement.
|
| Modifier and Type | Method and Description |
|---|---|
SwitchStatement |
clone()
Returns a clone of the switch statement.
|
static void |
defaultPrint(SwitchStatement s,
java.io.PrintWriter o)
Prints a switch statement to a stream.
|
CompoundStatement |
getBody()
Returns the body statement of the switch statement.
|
Expression |
getExpression()
Returns the value expression of the switch statement.
|
void |
setBody(CompoundStatement stmt)
Sets the body of the switch statement with the specified new statement.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setExpression(Expression value)
Sets the value of the switch statement with the specified new value.
|
annotate, annotateAfter, annotateBefore, containsAnnotation, detach, equals, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getChildren, getParent, getProcedure, hashCode, print, removeAnnotations, removeAnnotations, removeChild, setChild, setLineNumber, setParent, setPrintMethod, swapWith, toString, verify, wherepublic SwitchStatement(Expression value)
value - the expression to be evaluated for branching.java.lang.IllegalArgumentException - if value is null.NotAnOrphanException - if value has a parent.public SwitchStatement(Expression value, CompoundStatement stmt)
value - the expression to be evaluated for branching.stmt - the body of the switch statement.java.lang.IllegalArgumentException - if value or stmt is null.NotAnOrphanException - if value or stmt has a parent.public static void defaultPrint(SwitchStatement s, java.io.PrintWriter o)
s - The statement to print.o - The writer on which to print the statement.public CompoundStatement getBody()
public Expression getExpression()
public void setBody(CompoundStatement stmt)
stmt - the new body statement.java.lang.IllegalArgumentException - if stmt is null.NotAnOrphanException - if stmt has a parent.public void setExpression(Expression value)
value - the new value expression.java.lang.IllegalArgumentException - if value is null.NotAnOrphanException - if value has a parent.public static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public SwitchStatement clone()