APIdia Launch Partner
Top Description Methods
com.sun.source.tree

public Interface EnhancedForLoopTree

extends StatementTree
Known Direct Implementers
com.sun.tools.javac.tree.JCTree.JCEnhancedForLoop

A tree node for an "enhanced" for loop statement. For example:
  for ( variable : expression )
      statement
Authors
Peter von der Ahé, Jonathan Gibbons
Since
1.6
Java Language Specification
14.14.2 The enhanced for statement

Method Summary

Modifier and TypeMethod and Description
public ExpressionTree

Returns:

the expression
getExpression
()

Returns the expression yielding the values for the control variable.

public StatementTree

Returns:

the body of the loop
getStatement
()

Returns the body of the loop.

public VariableTree

Returns:

the control variable
getVariable
()

Returns the control variable for the loop.

Method Detail

getExpressionback to summary
public ExpressionTree getExpression()

Returns the expression yielding the values for the control variable.

Returns:ExpressionTree

the expression

getStatementback to summary
public StatementTree getStatement()

Returns the body of the loop.

Returns:StatementTree

the body of the loop

getVariableback to summary
public VariableTree getVariable()

Returns the control variable for the loop.

Returns:VariableTree

the control variable