uk.co.badgersinfoil.metaas.dom
Interface ASForInStatement

All Superinterfaces:
ScriptElement, Statement, StatementContainer

public interface ASForInStatement
extends Statement, StatementContainer

A for-in statement, such as for (v in a) { }.

e.g. The Java code

ASForInStatement forIn = method.newForIn("var v", "arr");
forEachIn.addStmt("trace(v)");

Will create ActionScript code like,

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

See Also:
StatementContainer.newForIn(Expression, Expression)

Method Summary
 Expression getIterated()
           
 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(Expression expr)
           
 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, 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

getVarString

java.lang.String getVarString()
Returns a string representation of the loop-variable declaration for this loop. e.g. given the loop for (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 (v in a) { }, this method will return the string "a".


getIterated

Expression getIterated()

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.

setIterated

void setIterated(Expression expr)


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