|
Groovy 2.2.0 | |||||||
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, List caseStatements, Statement defaultStatement)
|
Method Summary | |
---|---|
void
|
addCase(CaseStatement caseStatement)
|
CaseStatement
|
getCaseStatement(int idx)
@return the case statement of the given index or null |
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 Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
public SwitchStatement(Expression expression)
public SwitchStatement(Expression expression, Statement defaultStatement)
public SwitchStatement(Expression expression, List caseStatements, Statement defaultStatement)
Method Detail |
---|
public void addCase(CaseStatement caseStatement)
public CaseStatement getCaseStatement(int idx)
public List getCaseStatements()
public Statement getDefaultStatement()
public Expression getExpression()
public void setDefaultStatement(Statement defaultStatement)
public void setExpression(Expression e)
public void visit(GroovyCodeVisitor visitor)
Copyright © 2003-2013 The Codehaus. All rights reserved.