public class SynchronizedBlock extends JavaStatement implements StatementContainer, ExpressionContainer, ProgramPrefix
| Modifier and Type | Field and Description |
|---|---|
protected StatementBlock |
body
Body.
|
protected Expression |
expression
Expression.
|
private MethodFrame |
innerMostMethodFrame |
private int |
prefixLength |
| Constructor and Description |
|---|
SynchronizedBlock(Expression e,
StatementBlock body)
Synchronized block.
|
SynchronizedBlock(ExtList children)
Synchronized block.
|
SynchronizedBlock(StatementBlock body)
Synchronized block.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
expressionWithoutSideffects()
The method checks whether the expression in the synchronized
prefix is either a local variable or a meta class reference
(as local variables of this type are not supported by KeY,
see return value for
MetaClassReference.getKeYJavaType(Services, ExecutionContext). |
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 |
getExpression()
Get expression.
|
Expression |
getExpressionAt(int index) |
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.
|
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) |
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, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElementIncludingBlocks, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComments, matchequalsModRenaming, getEndPosition, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPositionprotected final Expression expression
protected final StatementBlock body
private final MethodFrame innerMostMethodFrame
private final int prefixLength
public SynchronizedBlock(StatementBlock body)
body - a statement block.public SynchronizedBlock(Expression e, StatementBlock body)
e - an expression.body - a statement block.public SynchronizedBlock(ExtList children)
children - a list with all childrenpublic boolean hasNextPrefixElement()
ProgramPrefixhasNextPrefixElement in interface ProgramPrefixpublic ProgramPrefix getNextPrefixElement()
ProgramPrefixgetNextPrefixElement in interface ProgramPrefixpublic ProgramPrefix getLastPrefixElement()
ProgramPrefixgetLastPrefixElement in interface ProgramPrefixpublic int getPrefixLength()
ProgramPrefixgetPrefixLength in interface ProgramPrefixpublic MethodFrame getInnerMostMethodFrame()
ProgramPrefixMethodFramegetInnerMostMethodFrame in interface ProgramPrefixpublic ImmutableArray<ProgramPrefix> getPrefixElements()
ProgramPrefixgetPrefixElements in interface ProgramPrefixprivate boolean expressionWithoutSideffects()
MetaClassReference.getKeYJavaType(Services, ExecutionContext).public PosInProgram getFirstActiveChildPos()
ProgramPrefixgetFirstActiveChildPos in interface ProgramPrefixpublic int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerpublic Expression getExpression()
public int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - 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 StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerpublic SourceElement getFirstElement()
JavaSourceElementgetFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getStartPosition()public void visit(Visitor v)
visit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.