for(Object o: objects) { ... }
It was introduced in Java 5.
| Modifier and Type | Field and Description |
|---|---|
| private Statement | |
| private Expression | |
| private VariableDeclarationExpr |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body)
|
| public | ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body)
This constructor is used by the parser and is considered private. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public <R, A> R | accept(final GenericVisitor<R, A>
the visitor implementation v, final A the argument passed to the visitor (of type A) arg)Implements com. |
| public <A> void | accept(final VoidVisitor<A>
the visitor implementation v, final A any value relevant for the visitor (of type A) arg)Implements com. |
| public ForEachStmt | |
| public ForEachStmt | clone()
Creates and returns a copy of this object.
|
| public Statement | |
| public Expression | |
| public ForEachStmtMetaModel | |
| public VariableDeclarationExpr | |
| public VariableDeclarator | Returns: this foreach statement's single variable declarator.Convenience method that directly returns this foreach statement's single variable declarator. |
| public boolean | Returns: true if this foreach statement's variable is final, and false otherwise.Convenience method that decides whether this foreach statement's variable is |
| public void | ifForEachStmt(Consumer<ForEachStmt> action)
Overrides com. |
| public boolean | |
| public boolean | |
| public boolean | |
| public ForEachStmt | |
| public ForEachStmt | |
| public ForEachStmt | |
| public Optional |
| body | back to summary |
|---|---|
| private Statement body | |
| iterable | back to summary |
|---|---|
| private Expression iterable | |
| variable | back to summary |
|---|---|
| private VariableDeclarationExpr variable | |
| ForEachStmt | back to summary |
|---|---|
| public ForEachStmt() | |
| ForEachStmt | back to summary |
|---|---|
public ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body)
| |
| ForEachStmt | back to summary |
|---|---|
| public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body) This constructor is used by the parser and is considered private.
| |
| ForEachStmt | back to summary |
|---|---|
| public ForEachStmt(VariableDeclarationExpr variable, String iterable, BlockStmt body) | |
| accept | back to summary |
|---|---|
| public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| accept | back to summary |
|---|---|
| public <A> void accept(final VoidVisitor<A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| asForEachStmt | back to summary |
|---|---|
| public ForEachStmt asForEachStmt() Overrides com.
| |
| clone | back to summary |
|---|---|
| public ForEachStmt clone() Overrides com. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| getBody | back to summary |
|---|---|
| public Statement getBody() Implements com.
| |
| getIterable | back to summary |
|---|---|
public Expression getIterable()
| |
| getMetaModel | back to summary |
|---|---|
| public ForEachStmtMetaModel getMetaModel() Overrides com.
| |
| getVariable | back to summary |
|---|---|
public VariableDeclarationExpr getVariable()
| |
| getVariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator getVariableDeclarator() Convenience method that directly returns this foreach statement's single variable declarator.
Note that any foreach statement's variable declaration expression (as returned by
Calling this method on a foreach statement
| |
| hasFinalVariable | back to summary |
|---|---|
| public boolean hasFinalVariable() Convenience method that decides whether this foreach statement's variable is
Calling this method on a foreach statement
| |
| ifForEachStmt | back to summary |
|---|---|
| public void ifForEachStmt(Consumer<ForEachStmt> action) Overrides com.
| |
| isForEachStmt | back to summary |
|---|---|
| public boolean isForEachStmt() Overrides com.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Node node) Overrides com.
| |
| replace | back to summary |
|---|---|
| public boolean replace(Node node, Node replacementNode) Overrides com.
| |
| setBody | back to summary |
|---|---|
| public ForEachStmt setBody(final Statement body) Implements com.
| |
| setIterable | back to summary |
|---|---|
public ForEachStmt setIterable(final Expression iterable)
| |
| setVariable | back to summary |
|---|---|
public ForEachStmt setVariable(final VariableDeclarationExpr variable)
| |
| toForEachStmt | back to summary |
|---|---|
| public Optional Overrides com.
| |