Class CtForImpl

All Implemented Interfaces:
Serializable, Cloneable, FactoryAccessor, CtBodyHolder, CtCodeElement, CtFor, CtLoop, CtStatement, SourcePositionHolder, CtElement, CtQueryable, CtVisitable, TemplateParameter<Void>

public class CtForImpl extends CtLoopImpl implements CtFor
See Also:
  • Constructor Details

    • CtForImpl

      public CtForImpl()
  • Method Details

    • accept

      public void accept(CtVisitor visitor)
      Description copied from interface: CtVisitable
      Accepts a visitor
      Specified by:
      accept in interface CtVisitable
    • getExpression

      public CtExpression<Boolean> getExpression()
      Description copied from interface: CtFor
      Gets the end-loop test expression.
      Specified by:
      getExpression in interface CtFor
    • setExpression

      public <T extends CtFor> T setExpression(CtExpression<Boolean> expression)
      Description copied from interface: CtFor
      Sets the end-loop test expression.
      Specified by:
      setExpression in interface CtFor
    • getForInit

      public List<CtStatement> getForInit()
      Description copied from interface: CtFor
      Gets the init statements.
      Specified by:
      getForInit in interface CtFor
    • addForInit

      public <T extends CtFor> T addForInit(CtStatement statement)
      Description copied from interface: CtFor
      Adds an init statement.
      Specified by:
      addForInit in interface CtFor
    • setForInit

      public <T extends CtFor> T setForInit(List<CtStatement> statements)
      Description copied from interface: CtFor
      Sets the init statements.
      Specified by:
      setForInit in interface CtFor
    • removeForInit

      public boolean removeForInit(CtStatement statement)
      Description copied from interface: CtFor
      Removes an init statement.
      Specified by:
      removeForInit in interface CtFor
    • getForUpdate

      public List<CtStatement> getForUpdate()
      Description copied from interface: CtFor
      Gets the update statements.
      Specified by:
      getForUpdate in interface CtFor
    • addForUpdate

      public <T extends CtFor> T addForUpdate(CtStatement statement)
      Description copied from interface: CtFor
      Adds an update statement.
      Specified by:
      addForUpdate in interface CtFor
    • setForUpdate

      public <T extends CtFor> T setForUpdate(List<CtStatement> statements)
      Description copied from interface: CtFor
      Sets the update statements.
      Specified by:
      setForUpdate in interface CtFor
    • removeForUpdate

      public boolean removeForUpdate(CtStatement statement)
      Description copied from interface: CtFor
      Removes an update statement.
      Specified by:
      removeForUpdate in interface CtFor
    • clone

      public CtFor clone()
      Description copied from interface: CtElement
      Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methods Refactoring.copyType(CtType) and Refactoring.copyMethod(CtMethod) instead which does additional work beyond cloning.
      Specified by:
      clone in interface CtCodeElement
      Specified by:
      clone in interface CtElement
      Specified by:
      clone in interface CtFor
      Specified by:
      clone in interface CtLoop
      Specified by:
      clone in interface CtStatement
      Overrides:
      clone in class CtLoopImpl
      Returns:
      a clone of this element. All children are cloned, but the parent of the returned clone is set to null.