public interface CtStatementList extends CtCodeElement, java.lang.Iterable<CtStatement>
CtBlock
.Modifier and Type | Method and Description |
---|---|
<T extends CtStatementList> |
addStatement(CtStatement statement)
Adds a statement at the end of the list.
|
<T extends CtStatementList> |
addStatement(int index,
CtStatement statement)
Inserts the given statement at a specific position in the list of statements
Shifts the statement currently at that position (if any) and any subsequent statements to the right (adds one to their indices).
|
CtStatementList |
clone()
Clone the element which calls this method in a new object.
|
<T extends CtStatement> |
getLastStatement()
Gets the last statement of this block.
|
<T extends CtStatement> |
getStatement(int i)
Gets the ith statement of this block.
|
java.util.List<CtStatement> |
getStatements()
Returns the statement list.
|
<T extends CtStatementList> |
insertAfter(Filter<? extends CtStatement> insertionPoints,
CtStatement statement)
Inserts the given statement after a set of insertion points given by a
filter.
|
<T extends CtStatementList> |
insertAfter(Filter<? extends CtStatement> insertionPoints,
CtStatementList statements)
Inserts the given statement list after a set of insertion points given by
a filter.
|
<T extends CtStatementList> |
insertBefore(Filter<? extends CtStatement> insertionPoints,
CtStatement statement)
Inserts the given statement before a set of insertion points given by a
filter.
|
<T extends CtStatementList> |
insertBefore(Filter<? extends CtStatement> insertionPoints,
CtStatementList statements)
Inserts the given statement list before a set of insertion points given
by a filter.
|
<T extends CtStatementList> |
insertBegin(CtStatement statement)
Inserts the given statement at the beginning of the block.
|
<T extends CtStatementList> |
insertBegin(CtStatementList statements)
Inserts the given statement list at the beginning of the block.
|
<T extends CtStatementList> |
insertEnd(CtStatement statement)
Inserts the given statement at the end of the block.
|
<T extends CtStatementList> |
insertEnd(CtStatementList statements)
Inserts the given statements at the end of the block.
|
void |
removeStatement(CtStatement statement)
Removes a statement.
|
<T extends CtStatementList> |
setStatements(java.util.List<CtStatement> statements)
Sets the statement list.
|
partiallyEvaluate
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
getFactory, setFactory
accept
filterChildren, map, map
java.util.List<CtStatement> getStatements()
<T extends CtStatementList> T setStatements(java.util.List<CtStatement> statements)
<T extends CtStatementList> T addStatement(CtStatement statement)
<T extends CtStatementList> T addStatement(int index, CtStatement statement)
<T extends CtStatementList> T insertBegin(CtStatement statement)
<T extends CtStatementList> T insertBegin(CtStatementList statements)
<T extends CtStatementList> T insertEnd(CtStatement statement)
<T extends CtStatementList> T insertEnd(CtStatementList statements)
<T extends CtStatementList> T insertBefore(Filter<? extends CtStatement> insertionPoints, CtStatement statement)
<T extends CtStatementList> T insertBefore(Filter<? extends CtStatement> insertionPoints, CtStatementList statements)
<T extends CtStatementList> T insertAfter(Filter<? extends CtStatement> insertionPoints, CtStatement statement)
<T extends CtStatementList> T insertAfter(Filter<? extends CtStatement> insertionPoints, CtStatementList statements)
<T extends CtStatement> T getStatement(int i)
<T extends CtStatement> T getLastStatement()
void removeStatement(CtStatement statement)
CtStatementList clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtCodeElement
clone
in interface CtElement
Copyright © 2007–2021 Inria. All rights reserved.