public class EnhancedFor extends LoopStatement implements VariableScope
body, guard, inits, updates
Constructor and Description |
---|
EnhancedFor()
create empty for loop.
|
EnhancedFor(ExtList children)
Used by the
CreatingASTVisitor . |
EnhancedFor(LoopInit init,
Guard guard,
Statement statement,
ExtList comments,
PositionInfo info)
Used for the Recoder2KeY transformation.
|
Modifier and Type | Method and Description |
---|---|
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
LocalVariableDeclaration |
getVariableDeclaration()
get the local variable declaration of the enhanced for-loop
for(type var : exp) gives type var . |
boolean |
isCheckedBeforeIteration()
Is checked before iteration.
|
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
public EnhancedFor()
public EnhancedFor(LoopInit init, Guard guard, Statement statement, ExtList comments, PositionInfo info)
init
- the initializers - here a single VariableDeclaration. may not be null.guard
- a guard - here an expression of type Iterable. may not be null.statement
- the statement of the loopcomments
- collected commentsinfo
- positionpublic EnhancedFor(ExtList children)
CreatingASTVisitor
.children
- a list of parameterspublic SourceElement getLastElement()
JavaSourceElement
getLastElement
in interface SourceElement
getLastElement
in class JavaSourceElement
For.getLastElement()
,
JavaSourceElement.getLastElement()
public boolean isCheckedBeforeIteration()
LoopStatement
isCheckedBeforeIteration
in class LoopStatement
For.isCheckedBeforeIteration()
,
LoopStatement.isCheckedBeforeIteration()
public void visit(Visitor v)
SourceElement
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.public LocalVariableDeclaration getVariableDeclaration()
for(type var : exp)
gives type var
.