|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ASForStatement
A for
statement, such as for (; ; ) { }
.
e.g. The Java code
ASForStatement forStmt = method.newFor("var i=0", "i<10", "i++"); forStmt.addStmt("trace(i)");
Will create ActionScript code like,
for (var i=0; i<10; i++) { trace(i); }
StatementContainer.newFor(Expression, Expression, Expression)
Method Summary | |
---|---|
Expression |
getCondition()
|
java.lang.String |
getConditionString()
Returns a string representation of the loop termination condition expression. |
ScriptElement |
getInit()
Returns a script element representing the initialisation part of this for-statement. |
java.lang.String |
getInitString()
Returns a string representation of the loop initialisation expression. |
Expression |
getUpdate()
|
java.lang.String |
getUpdateString()
Returns a string representation of the loop update expression. |
void |
setCondition(Expression expr)
|
void |
setCondition(java.lang.String expr)
Changes the termination condition expression for this loop. |
void |
setInit(java.lang.String expr)
Changes the initialisation expression for this loop. |
void |
setUpdate(Expression expr)
|
void |
setUpdate(java.lang.String expr)
Changes the update expression for this loop. |
Methods inherited from interface uk.co.badgersinfoil.metaas.dom.StatementContainer |
---|
addComment, addStmt, containsCode, getStatementList, newBreak, newContinue, newDeclaration, newDeclaration, newDefaultXMLNamespace, newDoWhile, newDoWhile, newExprStmt, newExprStmt, newFor, newFor, newForEachIn, newForEachIn, newForIn, newForIn, newIf, newIf, newReturn, newReturn, newReturn, newSuper, newSwitch, newSwitch, newThrow, newTryCatch, newTryFinally, newWhile, newWhile, newWith, newWith |
Method Detail |
---|
java.lang.String getInitString()
for (var i=0; i<10; i++)
, this
method will return the string "var i=0"
.
ScriptElement getInit()
The return value depends on the kind of initialiser present:
for (; ; )
null
for (v=1; ; )
Expression
for (var v=1; ; )
ASDeclarationStatement
java.lang.String getConditionString()
for (var i=0; i<10; i++)
, this
method will return the string "i<10"
.
Expression getCondition()
java.lang.String getUpdateString()
for (var i=0; i<10; i++)
, this
method will return the string "i++"
.
Expression getUpdate()
void setInit(java.lang.String expr)
SyntaxException
- if the given
string is not a valid ActionScript expression.void setCondition(java.lang.String expr)
SyntaxException
- if the given
string is not a valid ActionScript expression.void setCondition(Expression expr)
void setUpdate(java.lang.String expr)
SyntaxException
- if the given
string is not a valid ActionScript expression.void setUpdate(Expression expr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |