# Class: com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock

This class represents a basic block of generic instructions.

## Constructor: BasicBlock

Description: Create a new empty basic block.

## Constructor: BasicBlock
- parameter: `insnlist`, type: `java.util.Collection<InsnType>`

Description: Create a new basic block with the provided instructions.
parameter: insnlist: instructions to add to the block

## Method: add
- parameter: `insn`, type: `InsnType`

Description: **DANGEROUS\!** Append an instruction to the block. 

 The instruction is appended to the block. The edges are not updated.
 The caller is responsible for maintaining the consistency of the block and of the CFG.
parameter: insn: the instruction to be appended

## Method: add
- parameter: `index`, type: `int`
- parameter: `insn`, type: `InsnType`

Description: **DANGEROUS\!** Add an instruction to the block. 

 The instruction is inserted in the block. The edges are not updated.
 The caller is responsible for maintaining the consistency of the block and of the CFG.
parameter: index: insertion index
parameter: insn: the instruction to be inserted

## Method: addAll
- parameter: `insnlist`, type: `java.util.Collection<InsnType>`

Description: **DANGEROUS\!** Append instructions to the block. 

 The instructions are appended to the block. The edges are not updated.
 The caller is responsible for maintaining the consistency of the block and of the CFG.
parameter: insnlist: the collection of instructions to be appended

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


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


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


## Method: get
- parameter: `index`, type: `int`
- return type: `InsnType`


## Method: getAddress
- return type: `long`

Description: Get the block address.
return: the first instruction address

## Method: getAddressOfInstruction
- parameter: `index`, type: `int`
- return type: `long`


## Method: getAllInputBlocks
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getAllInputs
- return type: `java.lang.Iterable<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getAllOutputBlocks
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getAllOutputs
- return type: `java.lang.Iterable<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getBase
- return type: `long`


## Method: getEndAddress
- return type: `long`


## Method: getFirstAddress
- return type: `long`


## Method: getIndexOfInstruction
- parameter: `address`, type: `long`
- return type: `int`


## Method: getIndexOfInstruction
- parameter: `address`, type: `long`
- parameter: `precise`, type: `boolean`
- return type: `int`

Description: Get the index of an instruction by address.
parameter: address: instruction address
parameter: precise: if true, the address must match the instruction start; otherwise, any address            within the instruction is accepted
return: the instruction index, or \-1 if none was found

## Method: getInputBlock
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>`


## Method: getInputBlocks
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getInputOffsets
- return type: `java.util.List<java.lang.Long>`

Description: Get the addresses of regular input blocks.
return: a list of input block addresses

## Method: getInputs
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`

Description: Retrieve a read\-only list of input blocks \(regular\). 

 NOTE: This method is faster than [#getInputBlocks()](#getInputBlocks()) since it does not provide a copy of the list.
return: an unmodifiable view of regular input blocks

## Method: getInstruction
- parameter: `address`, type: `long`
- return type: `InsnType`


## Method: getInstructions
- return type: `java.util.List<InsnType>`


## Method: getIrregularInputBlock
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>`


## Method: getIrregularInputBlocks
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getIrregularInputOffsets
- return type: `java.util.List<java.lang.Long>`

Description: Get the addresses of irregular input blocks.
return: a list of irregular input block addresses

## Method: getIrregularInputs
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`

Description: Retrieve a read\-only list of irregular input blocks. 

 NOTE: This method is faster than [#getIrregularInputBlocks()](#getIrregularInputBlocks()) since it does not provide a copy of the list.
return: an unmodifiable view of irregular input blocks

## Method: getIrregularOutputBlock
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>`


## Method: getIrregularOutputBlocks
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getIrregularOutputOffsets
- return type: `java.util.List<java.lang.Long>`

Description: Get the addresses of irregular output blocks.
return: a list of irregular output block addresses

## Method: getIrregularOutputs
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`

Description: Retrieve a read\-only list of irregular output blocks. 

 NOTE: This method is faster than [#getIrregularOutputBlocks()](#getIrregularOutputBlocks()) since it does not provide a copy of the list.
return: an unmodifiable view of irregular output blocks

## Method: getLast
- return type: `InsnType`


## Method: getLastAddress
- return type: `long`


## Method: getOutputBlock
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>`


## Method: getOutputBlocks
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`


## Method: getOutputOffsets
- return type: `java.util.List<java.lang.Long>`

Description: Get the addresses of regular output blocks.
return: a list of output block addresses

## Method: getOutputs
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock<InsnType>>`

Description: Retrieve a read\-only list of output blocks \(regular\). 

 NOTE: This method is faster than [#getOutputBlocks()](#getOutputBlocks()) since it does not provide a copy of the list.
return: an unmodifiable view of regular output blocks

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


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


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


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


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


## Method: iterator
- return type: `java.util.Iterator<InsnType>`


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


## Method: remove
- parameter: `index`, type: `int`
- return type: `InsnType`

Description: **DANGEROUS\!** Remove an instruction from the block. 

 The instruction is removed from the block. The edges are not updated. The block may end up empty.
parameter: index: instruction index
return: true if the CFG need refreshing

## Method: removeAll

Description: **DANGEROUS\!** Remove all instructions from the block. 

 The edges are not updated. The block may end up empty.

## Method: set
- parameter: `index`, type: `int`
- parameter: `insn`, type: `InsnType`
- return type: `InsnType`

Description: Replace an instruction. The size is validated, the offset is not validated.
parameter: index: index in the block
parameter: insn: instruction to set at index
return: the instruction that was replaced

## Method: set
- parameter: `index`, type: `int`
- parameter: `insn`, type: `InsnType`
- parameter: `verifySize`, type: `boolean`
- parameter: `verifyOffset`, type: `boolean`
- return type: `InsnType`

Description: Replace an instruction. The size and offset may be validated.
parameter: index: index in the block
parameter: insn: instruction to set at index
parameter: verifySize: if false, validating and updating the instruction size is the            responsibility of the caller; else, the size is validated and must match the            replaced instruction's
parameter: verifyOffset: if false, validating and updating the instruction offset is the            responsibility of the caller; else, the offset is validated and must match the            replaced instruction's
return: the instruction that was replaced

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


## Method: toString
- return type: `java.lang.String`


