uk.co.badgersinfoil.metaas.dom
Interface ASForStatement

All Superinterfaces:
Statement, StatementContainer

public interface ASForStatement
extends Statement, StatementContainer

Obtained from StatementContainer.newFor(String,String,String), represents a for (; ; ) { } statement.

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);
}


Method Summary
 java.lang.String getConditionString()
          Returns a string representation of the loop termination condition expression.
 java.lang.String getInitString()
          Returns a string representation of the loop initialisation expression.
 java.lang.String getUpdateString()
          Returns a string representation of the loop update expression.
 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(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, newDeclaration, newDoWhile, newExprStmt, newFor, newForEachIn, newForIn, newIf, newReturn, newSwitch, newWhile, newWith
 

Method Detail

getInitString

java.lang.String getInitString()
Returns a string representation of the loop initialisation expression. e.g. given the loop for (var i=0; i<10; i++), this method will return the string "var i=0".


getConditionString

java.lang.String getConditionString()
Returns a string representation of the loop termination condition expression. e.g. given the loop for (var i=0; i<10; i++), this method will return the string "i<10".


getUpdateString

java.lang.String getUpdateString()
Returns a string representation of the loop update expression. e.g. given the loop for (var i=0; i<10; i++), this method will return the string "i++".


setInit

void setInit(java.lang.String expr)
Changes the initialisation expression for this loop.

Throws:
SyntaxException - if the given string is not a valid ActionScript expression.

setCondition

void setCondition(java.lang.String expr)
Changes the termination condition expression for this loop.

Throws:
SyntaxException - if the given string is not a valid ActionScript expression.

setUpdate

void setUpdate(java.lang.String expr)
Changes the update expression for this loop.

Throws:
SyntaxException - if the given string is not a valid ActionScript expression.


Copyright © 2006-2007 David Holroyd. All Rights Reserved.