public class For extends LoopStatement implements VariableScope
Modifier and Type | Field and Description |
---|---|
private static ImmutableArray<VariableSpecification> |
EMPTY_VARSPECS |
body, guard, inits, updates
Constructor and Description |
---|
For()
For.
|
For(ExtList children) |
For(ILoopInit inits,
IGuard guard,
IForUpdates updates,
Statement body) |
For(ILoopInit inits,
IGuard guard,
IForUpdates updates,
Statement body,
ExtList comments) |
For(ILoopInit inits,
IGuard guard,
IForUpdates updates,
Statement body,
ExtList comments,
PositionInfo pos) |
For(LoopInitializer[] inits,
Expression guard,
Expression[] updates,
Statement body)
For.
|
Modifier and Type | Method and Description |
---|---|
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
VariableSpecification |
getVariableInScope(java.lang.String name) |
ImmutableArray<VariableSpecification> |
getVariablesInScope() |
boolean |
isCheckedBeforeIteration()
Is checked before iteration.
|
boolean |
isDefinedScope() |
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
equals, getBody, getChildAt, getChildCount, getExpressionAt, getExpressionCount, getGuard, getGuardExpression, getIForUpdates, getILoopInit, getInitializers, getStatementAt, getStatementCount, getUpdates
compatibleBlockSize, computeHashCode, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildAt, getChildCount
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPosition
private static final ImmutableArray<VariableSpecification> EMPTY_VARSPECS
public For()
public For(LoopInitializer[] inits, Expression guard, Expression[] updates, Statement body)
inits
- a loop initializer mutable list.guard
- an expression.updates
- an expression mutable list.body
- a statement.public For(ILoopInit inits, IGuard guard, IForUpdates updates, Statement body, ExtList comments)
public For(ILoopInit inits, IGuard guard, IForUpdates updates, Statement body, ExtList comments, PositionInfo pos)
public For(ILoopInit inits, IGuard guard, IForUpdates updates, Statement body)
public For(ExtList children)
public SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getEndPosition()
public boolean isCheckedBeforeIteration()
isCheckedBeforeIteration
in class LoopStatement
public boolean isDefinedScope()
public ImmutableArray<VariableSpecification> getVariablesInScope()
public VariableSpecification getVariableInScope(java.lang.String name)
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
p
- a pretty printer.java.io.IOException
- occasionally thrown.