|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.ast.ASTNode org.codehaus.groovy.ast.stmt.Statement org.codehaus.groovy.ast.stmt.SwitchStatement
public class SwitchStatement extends Statement
Represents a switch (object) { case value: ... case [1, 2, 3]: ... default: ... } statement in Groovy.
Constructor Summary | |
SwitchStatement(Expression expression)
|
|
SwitchStatement(Expression expression, Statement defaultStatement)
|
|
SwitchStatement(Expression expression, java.util.List caseStatements, Statement defaultStatement)
|
Method Summary | |
---|---|
void
|
addCase(CaseStatement caseStatement)
|
CaseStatement
|
getCaseStatement(int idx)
@return the case statement of the given index or null |
java.util.List
|
getCaseStatements()
|
Statement
|
getDefaultStatement()
|
Expression
|
getExpression()
|
void
|
setDefaultStatement(Statement defaultStatement)
|
void
|
setExpression(Expression e)
|
void
|
visit(GroovyCodeVisitor visitor)
|
Methods inherited from class Statement | |
---|---|
getStatementLabel, isEmpty, setStatementLabel |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public SwitchStatement(Expression expression)
public SwitchStatement(Expression expression, Statement defaultStatement)
public SwitchStatement(Expression expression, java.util.List caseStatements, Statement defaultStatement)
Method Detail |
---|
public void addCase(CaseStatement caseStatement)
public CaseStatement getCaseStatement(int idx)
public java.util.List getCaseStatements()
public Statement getDefaultStatement()
public Expression getExpression()
public void setDefaultStatement(Statement defaultStatement)
public void setExpression(Expression e)
public void visit(GroovyCodeVisitor visitor)
Groovy Documentation