public interface

IJavaFor

implements IJavaCompound
com.pnfsoftware.jeb.core.units.code.java.IJavaFor

Class Overview

Java AST interface used to represent a standard for loop statement. A for loop is a pre-tested loop, that consists of an initializer statement, a test predicate, a post-iteration statement, and a body.

Example:

 for(initializer; predicate; poststm) {
     // body
 }
 

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
Public Methods
abstract IJavaFor duplicate()
Duplicate this element.
abstract IJavaBlock getBody()
Get the loop body.
abstract IJavaStatement getInitializer()
Get the initializer statement.
abstract IJavaStatement getPostStatement()
Get the post-iteration statement.
abstract IJavaPredicate getPredicate()
Get the loop predicate.
abstract void setBody(IJavaBlock b)
Set the loop post-iteration statement.
abstract void setInitializer(IJavaStatement initializer)
Set the loop initializer statement.
abstract void setPostStatement(IJavaStatement poststm)
Set the loop post-iteration statement.
abstract void setPredicate(IJavaPredicate p)
Set the loop predicate.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaCompound
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaExpression
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaStatement

Public Methods

public abstract IJavaFor duplicate ()

Duplicate this element.

Returns
  • a (possibly) duplicated object of the same type

public abstract IJavaBlock getBody ()

Get the loop body.

Returns
  • the loop body, never null

public abstract IJavaStatement getInitializer ()

Get the initializer statement.

Returns
  • the initializer statement, may be null

public abstract IJavaStatement getPostStatement ()

Get the post-iteration statement.

Returns
  • the post-iteration statement, may be null

public abstract IJavaPredicate getPredicate ()

Get the loop predicate.

Returns
  • the loop predicate, may be null

public abstract void setBody (IJavaBlock b)

Set the loop post-iteration statement.

Parameters
b mandatory loop body

public abstract void setInitializer (IJavaStatement initializer)

Set the loop initializer statement.

Parameters
initializer optional initializer

public abstract void setPostStatement (IJavaStatement poststm)

Set the loop post-iteration statement.

Parameters
poststm optional post-iteration statement

public abstract void setPredicate (IJavaPredicate p)

Set the loop predicate.

Parameters
p optional loop predicate