public final class ForEachStmt extends Statement implements NodeWithBody<ForEachStmt>
for(Object o: objects) { ... }
It was introduced in Java 5.Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY
Constructor and Description |
---|
ForEachStmt() |
ForEachStmt(TokenRange tokenRange,
VariableDeclarationExpr variable,
Expression iterable,
Statement body)
This constructor is used by the parser and is considered private.
|
ForEachStmt(VariableDeclarationExpr variable,
Expression iterable,
Statement body) |
ForEachStmt(VariableDeclarationExpr variable,
String iterable,
BlockStmt body) |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
ForEachStmt |
asForeachStmt() |
ForEachStmt |
asForEachStmt() |
ForEachStmt |
clone() |
Statement |
getBody() |
Expression |
getIterable() |
ForEachStmtMetaModel |
getMetaModel() |
VariableDeclarationExpr |
getVariable() |
void |
ifForeachStmt(Consumer<ForEachStmt> action) |
void |
ifForEachStmt(Consumer<ForEachStmt> action) |
boolean |
isForeachStmt() |
boolean |
isForEachStmt() |
boolean |
remove(Node node) |
boolean |
replace(Node node,
Node replacementNode) |
ForEachStmt |
setBody(Statement body) |
ForEachStmt |
setIterable(Expression iterable) |
ForEachStmt |
setVariable(VariableDeclarationExpr variable) |
Optional<ForEachStmt> |
toForeachStmt() |
Optional<ForEachStmt> |
toForEachStmt() |
asAssertStmt, asBlockStmt, asBreakStmt, asContinueStmt, asDoStmt, asEmptyStmt, asExplicitConstructorInvocationStmt, asExpressionStmt, asForStmt, asIfStmt, asLabeledStmt, asLocalClassDeclarationStmt, asReturnStmt, asSwitchEntryStmt, asSwitchStmt, asSynchronizedStmt, asThrowStmt, asTryStmt, asUnparsableStmt, asWhileStmt, ifAssertStmt, ifBlockStmt, ifBreakStmt, ifContinueStmt, ifDoStmt, ifEmptyStmt, ifExplicitConstructorInvocationStmt, ifExpressionStmt, ifForStmt, ifIfStmt, ifLabeledStmt, ifLocalClassDeclarationStmt, ifReturnStmt, ifSwitchEntryStmt, ifSwitchStmt, ifSynchronizedStmt, ifThrowStmt, ifTryStmt, ifUnparsableStmt, ifWhileStmt, isAssertStmt, isBlockStmt, isBreakStmt, isContinueStmt, isDoStmt, isEmptyStmt, isExplicitConstructorInvocationStmt, isExpressionStmt, isForStmt, isIfStmt, isLabeledStmt, isLocalClassDeclarationStmt, isReturnStmt, isSwitchEntryStmt, isSwitchStmt, isSynchronizedStmt, isThrowStmt, isTryStmt, isUnparsableStmt, isWhileStmt, toAssertStmt, toBlockStmt, toBreakStmt, toContinueStmt, toDoStmt, toEmptyStmt, toExplicitConstructorInvocationStmt, toExpressionStmt, toForStmt, toIfStmt, toLabeledStmt, toLocalClassDeclarationStmt, toReturnStmt, toSwitchEntryStmt, toSwitchStmt, toSynchronizedStmt, toThrowStmt, toTryStmt, toUnparsableStmt, toWhileStmt
addOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getSymbolResolver, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
finalize, getClass, notify, notifyAll, wait, wait, wait
createBlockStatementAsBody
findAncestor, findAncestor, findParent, getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
public ForEachStmt()
public ForEachStmt(VariableDeclarationExpr variable, Expression iterable, Statement body)
public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body)
public ForEachStmt(VariableDeclarationExpr variable, String iterable, BlockStmt body)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitable
accept
in interface Visitable
R
- the type of the return value of the visitorA
- the type the user argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitable
public Statement getBody()
getBody
in interface NodeWithBody<ForEachStmt>
public Expression getIterable()
public VariableDeclarationExpr getVariable()
public ForEachStmt setBody(Statement body)
setBody
in interface NodeWithBody<ForEachStmt>
public ForEachStmt setIterable(Expression iterable)
public ForEachStmt setVariable(VariableDeclarationExpr variable)
public ForEachStmt clone()
public boolean isForeachStmt()
isForeachStmt
in class Statement
public ForEachStmt asForeachStmt()
asForeachStmt
in class Statement
public void ifForeachStmt(Consumer<ForEachStmt> action)
ifForeachStmt
in class Statement
public Optional<ForEachStmt> toForeachStmt()
toForeachStmt
in class Statement
public boolean isForEachStmt()
isForEachStmt
in class Statement
public ForEachStmt asForEachStmt()
asForEachStmt
in class Statement
public Optional<ForEachStmt> toForEachStmt()
toForEachStmt
in class Statement
public void ifForEachStmt(Consumer<ForEachStmt> action)
ifForEachStmt
in class Statement
public ForEachStmtMetaModel getMetaModel()
getMetaModel
in class Statement
Copyright © 2007–2018. All rights reserved.