public interface CtForEach extends CtLoop
java.util.List l = new java.util.ArrayList(); for(Object o : l) { // <-- foreach loop System.out.println(o); }
Modifier and Type | Method and Description |
---|---|
CtForEach |
clone()
Clone the element which calls this method in a new object.
|
CtExpression<?> |
getExpression()
Gets the iterated expression (an iterable of an array).
|
CtLocalVariable<?> |
getVariable()
Gets the variable that references the currently iterated element.
|
<T extends CtForEach> |
setExpression(CtExpression<?> expression)
Sets the iterated expression (an iterable of an array).
|
<T extends CtForEach> |
setVariable(CtLocalVariable<?> variable)
Sets the variable that references the currently iterated element.
|
comment, getLabel, insertAfter, insertAfter, insertBefore, insertBefore, setLabel
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
S
setBody
CtExpression<?> getExpression()
CtLocalVariable<?> getVariable()
<T extends CtForEach> T setExpression(CtExpression<?> expression)
<T extends CtForEach> T setVariable(CtLocalVariable<?> variable)
CtForEach clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtCodeElement
clone
in interface CtElement
clone
in interface CtLoop
clone
in interface CtStatement
Copyright © 2007–2021 Inria. All rights reserved.