# Interface: com.pnfsoftware.jeb.core.units.code.java.IJavaBlock

Java AST interface to represent a sequence of [statements](IJavaStatement). 

 Example:  

```

 {
     stm0;
     stm1;
     stm2;
 }
 
```
 

 Statements cannot be null. An exception will be raised if an attempt to insert a null statement is made.

## Method: add
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: Append a statement to this block.
parameter: stm: mandatory statement to be appended

## Method: addAll
- parameter: `b`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`


## Method: addMultiple
- parameter: `src`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`
- parameter: `start`, type: `int`
- parameter: `end`, type: `int`
- parameter: `removeSourceStatements`, type: `boolean`


## Method: clear

Description: Remove all statements of the block, making the block effectively empty: {}

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`


## Method: generateBody
- parameter: `out`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink`


## Method: generateBody
- parameter: `out`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink`
- parameter: `expectLambdaExpression`, type: `boolean`

Description: Raw body generation, the caller is responsible for calling generateEnter/generateExit
parameter: out: 
parameter: expectLambdaExpression: 

## Method: generateFooter
- parameter: `out`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink`


## Method: generateHeader
- parameter: `out`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink`


## Method: get
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: Get the statement at a given index.
parameter: index: 0\-based statement index
return: the statement

## Method: getLast
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: Get the last statement from the block.
return: the non\-null statement

## Method: insert
- parameter: `index`, type: `int`
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: Insert a statement at the given index.
parameter: index: 0\-based statement index
parameter: stm: mandatory statement to be inserted

## Method: insertAll
- parameter: `index`, type: `int`
- parameter: `b`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: Insert all statements of another block in this block.
parameter: index: 0\-based index
parameter: b: mandatory block

## Method: insertMultiple
- parameter: `index`, type: `int`
- parameter: `src`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`
- parameter: `start`, type: `int`
- parameter: `end`, type: `int`
- parameter: `removeSourceStatements`, type: `boolean`


## Method: isEmpty
- return type: `boolean`


## Method: remove
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: Pull a statement from the block.
parameter: index: 0\-based statement index
return: the removed statement

## Method: remove
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`
- return type: `boolean`

Description: Remove a statement from the block. Does not throw if the statement is not found.
parameter: stm: mandatory statement
return: success indicator

## Method: removeLast
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: 
return: 

## Method: removeMultiple
- parameter: `index`, type: `int`
- parameter: `cnt`, type: `int`

Description: 
parameter: index: 
parameter: cnt: 

## Method: removeRange
- parameter: `from`, type: `int`
- parameter: `to`, type: `int`

Description: 
parameter: from: 
parameter: to: 

## Method: set
- parameter: `index`, type: `int`
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaStatement`

Description: Replace a statement by another statement.
parameter: index: 0\-based statement index
parameter: stm: mandatory statement

## Method: size
- return type: `int`

Description: Get the number of statements in this block. 

 Note: [Compound statements](IJavaCompound) count for a single statement.
return: the number of statements

