Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

javax.ide.model.java.source.tree
Interface ForStatementT

All Superinterfaces:
BlockElementT, CompoundStatementT, StatementT, Tree

public interface ForStatementT
extends CompoundStatementT

A for statement. JLS3 14.14.


Nested Class Summary
static class ForStatementT.ForKind
          In this version, this class is 1.4 compatible.
 
Field Summary
 
Fields inherited from interface javax.ide.model.java.source.tree.StatementT
EMPTY_ARRAY
 
Method Summary
 ExpressionT getForCollection()
          In an enhanced for loop, this is the collection expression.
 ExpressionT getForConditional()
          In a standard for loop, this is the condition expression.
 ListExpressionT getForInitializationList()
          In a standard for loop with no variable declarations, this is the list wrapping the initialization terms.
 java.util.List getForInitializations()
          In a standard for loop with no variable declarations, these are the initialization terms.
 ForStatementT.ForKind getForKind()
           
 ListExpressionT getForUpdateList()
          In a standard for loop, this is the list wrapping the update terms.
 java.util.List getForUpdates()
          In a standard for loop, these are the update terms.
 LocalVariableDeclT getForVariableDeclaration()
          In a standard for loop with variable declarations, this is the local variable declaration itself.
 java.util.List getForVariables()
          In a standard for loop with variable declarations, these are the variables declared in the initialization declaration.
 void setForCollection(ExpressionT e)
          Attempts to set the collection expression on this for statement.
 void setForConditional(ExpressionT e)
          Attempts to set the conditional expression on this for statement.
 void setForVariableDeclaration(LocalVariableDeclT decl)
          Attempts to set the variable declaration on this for statement.
 
Methods inherited from interface javax.ide.model.java.source.tree.CompoundStatementT
getControlExpression, getEndClause, getPrimaryClause
 
Methods inherited from interface javax.ide.model.java.source.tree.StatementT
getStatementLabels
 
Methods inherited from interface javax.ide.model.java.source.tree.Tree
accept, addSelf, addSelf, addSelfAfter, addSelfBefore, clearProperty, cloneSelf, getChildren, getOwningFile, getParent, getPosition, getProperty, getSiblingAfter, getSiblingBefore, getSiblings, getTreeKind, isSynthetic, removeSelf, replaceSelf, setProperty
 

Method Detail

getForKind

ForStatementT.ForKind getForKind()
Returns:
Valid values are ForKind.*.

getForVariableDeclaration

LocalVariableDeclT getForVariableDeclaration()
In a standard for loop with variable declarations, this is the local variable declaration itself.

Returns:
The local variable declaration. Null if none.

setForVariableDeclaration

void setForVariableDeclaration(LocalVariableDeclT decl)
Attempts to set the variable declaration on this for statement.

Throws:
java.lang.UnsupportedOperationException - if this for loop does not allow a variable declaration.

getForVariables

java.util.List getForVariables()
In a standard for loop with variable declarations, these are the variables declared in the initialization declaration. If there is a variable declaration, then this is equivalent to calling getForVariableDeclaration().getVariables().

Returns:
The array of variable declarations.

List of LocalVariableTs.


getForInitializationList

ListExpressionT getForInitializationList()
In a standard for loop with no variable declarations, this is the list wrapping the initialization terms. Unless you need the actual ListExpression, you should probably use getForInitializations().

Returns:
The ListExpression wrapping the initializations. Null if none.

getForInitializations

java.util.List getForInitializations()
In a standard for loop with no variable declarations, these are the initialization terms. If there are initialization terms, this is equivalent to calling getForInitializationList().getOperands().

Returns:
The array of initialization terms.

List of ExpressionTs.


getForConditional

ExpressionT getForConditional()
In a standard for loop, this is the condition expression. Syntax is "for( initialization; conditional; update) stmt".

Returns:
The conditional term. Null if there is none.

setForConditional

void setForConditional(ExpressionT e)
Attempts to set the conditional expression on this for statement.

Throws:
java.lang.UnsupportedOperationException - if this is an enhanced for loop.

getForUpdateList

ListExpressionT getForUpdateList()
In a standard for loop, this is the list wrapping the update terms. Syntax is "for( initialization; conditional; update) stmt". Unless you need the actual ListExpression, you should probably use getForUpdates().

Returns:
The ListExpression wrapping the updates. Null if none.

getForUpdates

java.util.List getForUpdates()
In a standard for loop, these are the update terms. Syntax is "for( initialization; conditional; update) stmt". If there are update terms, this is equivalent to calling getForUpdateList().getOperands().

Returns:
The array of update terms.

List of ExpressionTs.


getForCollection

ExpressionT getForCollection()
In an enhanced for loop, this is the collection expression. Syntax is "for ( type name: collection ) stmt".

Returns:
The expression for the collection term.

setForCollection

void setForCollection(ExpressionT e)
Attempts to set the collection expression on this for statement.

Throws:
java.lang.UnsupportedOperationException - if this is not an enhanced for loop.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.