uk.co.badgersinfoil.metaas.dom
Interface ASForEachInStatement

All Superinterfaces:
Statement, StatementContainer

public interface ASForEachInStatement
extends Statement, StatementContainer

Obtained from StatementContainer.newForEachIn(String,String), represents a for each(v in a) { } statement.

e.g. The Java code

ASForEachInStatement forEachIn = method.newForEachIn("var v", "arr");
forEachIn.addStmt("trace(v)");

Will create ActionScript code like,

for each(var v in arr) {
        trace(v);
}


Method Summary
 java.lang.String getIteratedString()
          Returns a string representation of the expression whose value will iterated over.
 java.lang.String getVarString()
          Returns a string representation of the loop-variable declaration for this loop.
 void setIterated(java.lang.String expr)
          Changes the expression whose value will be iterated over by this loop.
 void setVar(java.lang.String expr)
          Specifies the loop-variable declaration 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

getVarString

java.lang.String getVarString()
Returns a string representation of the loop-variable declaration for this loop. e.g. given the loop for each(v in a) { }, this method will return the string "v".


getIteratedString

java.lang.String getIteratedString()
Returns a string representation of the expression whose value will iterated over. e.g. given the loop for each(v in a) { }, this method will return the string "a".


setVar

void setVar(java.lang.String expr)
Specifies the loop-variable declaration for this loop.

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

setIterated

void setIterated(java.lang.String expr)
Changes the expression whose value will be iterated over by this loop.

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


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