public interface

IJavaBlock

implements ICompound
com.pnfsoftware.jeb.core.units.code.java.IJavaBlock

Class Overview

Java AST interface to represent a sequence of statements.

Example:

 {
     stm0;
     stm1;
     stm2;
 }
 

Statements cannot be null. The following methods will raise if attempts to insert null statements are detected.

Summary

Public Methods
abstract void add(IStatement stm)
Append a statement to this block.
abstract IStatement get(int index)
Get the statement at a given index.
abstract void insert(int index, IStatement stm)
Insert a statement at the given index.
abstract IStatement remove(int index)
Pull a statement from the block.
abstract void set(int index, IStatement stm)
Replace a statement by another statement.
abstract int size()
Get the number of statements in this block.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.java.ICompound
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement

Public Methods

public abstract void add (IStatement stm)

Append a statement to this block.

Parameters
stm mandatory statement to be appended

public abstract IStatement get (int index)

Get the statement at a given index.

Parameters
index 0-based statement index
Returns
  • the statement

public abstract void insert (int index, IStatement stm)

Insert a statement at the given index.

Parameters
index 0-based statement index
stm mandatory statement to be inserted

public abstract IStatement remove (int index)

Pull a statement from the block.

Parameters
index 0-based statement index
Returns
  • the removed statement

public abstract void set (int index, IStatement stm)

Replace a statement by another statement.

Parameters
index 0-based statement index
stm mandatory statement

public abstract int size ()

Get the number of statements in this block.

Note: Compound statements count for a single statement.

Returns
  • the number of statements