com.togethersoft.sca.ast
Interface AstForStatement

All Superinterfaces:
AstObject, AstStatement

public interface AstForStatement
extends AstStatement

Represents a for loop statement. For example:

     for (int i = 0; i < arr.length; i++) {
         arr[i] = 0;
     }
 


Fields inherited from interface com.togethersoft.sca.ast.AstObject
ARRAY_CREATION, ARRAY_INITIALIZER, ARRAY_REFERENCE, ASSERT_STATEMENT, ASSIGNMENT_EXPRESSION, BINARY_EXPRESSION, BREAK_STATEMENT, CASE_LABEL, CAST_EXPRESSION, CATCH_CLAUSE, CLASS_FILE, COMMENT, COMPILATION_UNIT, COMPOUND_STATEMENT, CONDITIONAL_EXPRESSION, CONSTRUCTOR_INVOCATION, CONTINUE_STATEMENT, DBC_RESULT, DECLARATION_STATEMENT, DO_STATEMENT, EMPTY_STATEMENT, EXPRESSION_STATEMENT, FIELD_REFERENCE, FINALLY_CLAUSE, FOR_STATEMENT, IF_STATEMENT, IMPORT, INITIALIZER, JAVADOC_TAG, LITERAL, METHOD, METHOD_CALL_EXPRESSION, N_A, OBJECT_CREATION_EXPRESSION, PACKAGE, PARENTHESIZED_EXPRESSION, RETURN_STATEMENT, SIMPLE_REFERENCE, SUPER_EXPRESSION, SWITCH_GROUP, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THIS_EXPRESSION, THROW_SPECIFIER, THROW_STATEMENT, TRY_STATEMENT, TYPE, TYPE_EXPRESSION, UNARY_EXPRESSION, VARIABLE, VARIABLE_DECLARATION, WHILE_STATEMENT
 
Method Summary
 AstStatement getBody()
          Returns the body of this for loop.
 AstExpression getCondition()
          Returns condition expression of this for loop.
 AstStatement[] getInitializers()
          Returns initializer statements of this for loop.
 AstStatement[] getUpdateStatements()
          Returns update statements of this for loop.
 
Methods inherited from interface com.togethersoft.sca.ast.AstStatement
getLabelNames
 
Methods inherited from interface com.togethersoft.sca.ast.AstObject
addComment, getChildren, getComments, getCompilationUnit, getDeclaringMethod, getDeclaringType, getObjectKind, getPackage, getParent, getPosition, isDeleted, remove, replaceWith, replaceWith, setPosition, setPositionAfter, visitExpressions, visitStatements
 

Method Detail

getBody

public AstStatement getBody()
Returns the body of this for loop.
Returns:
the body of this loop.

getCondition

public AstExpression getCondition()
Returns condition expression of this for loop. Returns null if no condition expression is provided.
Returns:
the condition expression of this loop.

getInitializers

public AstStatement[] getInitializers()
Returns initializer statements of this for loop. These can be expression statements or variable declarations. Returns an empty array if this loop has no initializers.
Returns:
the initializers of this loop.

getUpdateStatements

public AstStatement[] getUpdateStatements()
Returns update statements of this for loop. These are always expression statements. Returns an empty array if this loop has no update statements.
Returns:
the update statements of this loop.