public class LoopScopeBlock extends JavaStatement implements StatementContainer, ExpressionContainer, ProgramPrefix
Modifier and Type | Field and Description |
---|---|
protected StatementBlock |
body |
protected IProgramVariable |
indexPV |
private MethodFrame |
innerMostMethodFrame |
private int |
prefixLength |
Constructor and Description |
---|
LoopScopeBlock(ExtList children)
Synchronized block.
|
LoopScopeBlock(IProgramVariable iProgramVariable,
StatementBlock body)
TODO
|
LoopScopeBlock(StatementBlock body)
TODO
|
Modifier and Type | Method and Description |
---|---|
StatementBlock |
getBody()
Get body.
|
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual" child
array
|
int |
getChildCount()
Returns the number of children of this node.
|
Expression |
getExpressionAt(int index)
Return the expression at the specified index in this node's "virtual"
expression array.
|
int |
getExpressionCount()
Get the number of expressions in this container.
|
PosInProgram |
getFirstActiveChildPos()
returns the position of the first active child
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
IProgramVariable |
getIndexPV()
Get expression.
|
MethodFrame |
getInnerMostMethodFrame()
returns the inner most
MethodFrame |
ProgramPrefix |
getLastPrefixElement()
return the last prefix element
|
ProgramPrefix |
getNextPrefixElement()
return the next prefix element
if no next prefix element is available an IndexOutOfBoundsException is thrown
|
ImmutableArray<ProgramPrefix> |
getPrefixElements()
returns an array with all prefix elements starting at
this element
|
int |
getPrefixLength()
returns the length of the prefix
|
Statement |
getStatementAt(int index)
Return the statement at the specified index in this node's "virtual"
statement array.
|
int |
getStatementCount()
Get the number of statements in this container.
|
boolean |
hasNextPrefixElement()
return true if there is a next prefix element
|
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
|
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElementIncludingBlocks, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
equalsModRenaming, getEndPosition, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition
protected final IProgramVariable indexPV
protected final StatementBlock body
private final MethodFrame innerMostMethodFrame
private final int prefixLength
public LoopScopeBlock(StatementBlock body)
body
- public LoopScopeBlock(IProgramVariable iProgramVariable, StatementBlock body)
e
- body
- public LoopScopeBlock(ExtList children)
children
- a list with all childrenpublic boolean hasNextPrefixElement()
ProgramPrefix
hasNextPrefixElement
in interface ProgramPrefix
public ProgramPrefix getNextPrefixElement()
ProgramPrefix
getNextPrefixElement
in interface ProgramPrefix
public ProgramPrefix getLastPrefixElement()
ProgramPrefix
getLastPrefixElement
in interface ProgramPrefix
public int getPrefixLength()
ProgramPrefix
getPrefixLength
in interface ProgramPrefix
public MethodFrame getInnerMostMethodFrame()
ProgramPrefix
MethodFrame
getInnerMostMethodFrame
in interface ProgramPrefix
public ImmutableArray<ProgramPrefix> getPrefixElements()
ProgramPrefix
getPrefixElements
in interface ProgramPrefix
public PosInProgram getFirstActiveChildPos()
ProgramPrefix
getFirstActiveChildPos
in interface ProgramPrefix
public int getExpressionCount()
getExpressionCount
in interface ExpressionContainer
public Expression getExpressionAt(int index)
getExpressionAt
in interface ExpressionContainer
index
- an index for an expression.java.lang.ArrayIndexOutOfBoundsException
- if index is out of bounds.public IProgramVariable getIndexPV()
public int getChildCount()
getChildCount
in interface NonTerminalProgramElement
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out of boundspublic StatementBlock getBody()
public int getStatementCount()
getStatementCount
in interface StatementContainer
public Statement getStatementAt(int index)
getStatementAt
in interface StatementContainer
index
- an index for a statement.java.lang.ArrayIndexOutOfBoundsException
- if index is out of bounds.public SourceElement getFirstElement()
JavaSourceElement
getFirstElement
in interface SourceElement
getFirstElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getStartPosition()
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.