|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ASSwitchStatement
A switch-statement, such as switch (c) { }
.
Allows case
and default
statements to be added
to to the switch-statement body.
e.g.
ASSwitchStatement switchStmt = method.newSwitch("c"); switchStmt.newCase("'a'").addStmt("aay()"); switchStmt.newCase("'b'").addStmt("bee()"); switchStmt.newDefault().addStmt("cee()");Will result in ActionScript something like,
switch(c) { case 'a': aay(); case 'b': bee(); default: cee(); }
To add break
statements to either case
or
default
labels, use switchLabel.newBreak()
.
StatementContainer.newSwitch(String)
,
ASSwitchCase
,
ASSwitchDefault
Method Summary | |
---|---|
Expression |
getCondition()
|
java.util.List |
getLabels()
Returns a list of SwitchLabel elements (i.e. |
ASSwitchCase |
newCase(java.lang.String string)
Creates a case -label in this switch-statement with the given value,
to which other statements can be added. |
ASSwitchDefault |
newDefault()
Creates a default -label in this switch-statement, to
which other statements can be added. |
void |
setCondition(Expression expr)
|
Method Detail |
---|
ASSwitchCase newCase(java.lang.String string)
case
-label in this switch-statement with the given value,
to which other statements can be added.
ASSwitchDefault newDefault()
default
-label in this switch-statement, to
which other statements can be added.
Expression getCondition()
void setCondition(Expression expr)
java.util.List getLabels()
SwitchLabel
elements (i.e. either
ASSwitchCase
or ASSwitchDefault
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |