Package org.apache.sysds.runtime.controlprogram

## Class BasicProgramBlock

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.ProgramBlock
  - - org.apache.sysds.runtime.controlprogram.BasicProgramBlock

All Implemented Interfaces:
  `ParseInfo`

    public class BasicProgramBlock
    extends ProgramBlock

### Field Summary

### Fields inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock

`_beginColumn, _beginLine, _endColumn, _endLine, _filename, _text, PRED_VAR`

### Constructor Summary

Constructors
`BasicProgramBlock​(Program prog)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addInstruction​(Instruction inst)`
`void` `addInstructions​(ArrayList<Instruction> inst)`
`void` `execute​(ExecutionContext ec)` Executes this program block (incl recompilation if required).
`ArrayList<ProgramBlock>` `getChildBlocks()` Get the list of child program blocks if nested; otherwise this method returns null.
`Instruction` `getInstruction​(int i)`
`ArrayList<Instruction>` `getInstructions()`
`int` `getNumInstructions()`
`boolean` `isNested()` Indicates if the program block is nested, i.e., if it contains other program blocks (e.g., loops).
`void` `setInstructions​(ArrayList<Instruction> inst)`

### Methods inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock

`executePredicate, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getExitInstruction, getFilename, getProgram, getStatementBlock, getText, getThreadID, hasThreadID, isThreadID, printBlockErrorLocation, setBeginColumn, setBeginLine, setEndColumn, setEndLine, setExitInstruction, setFilename, setParseInfo, setProgram, setStatementBlock, setText, setThreadID`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### BasicProgramBlock

    public BasicProgramBlock​(Program prog)

### Method Detail

#### getInstructions

    public ArrayList<Instruction> getInstructions()

#### getInstruction

    public Instruction getInstruction​(int i)

#### setInstructions

    public void setInstructions​(ArrayList<Instruction> inst)

#### addInstruction

    public void addInstruction​(Instruction inst)

#### addInstructions

    public void addInstructions​(ArrayList<Instruction> inst)

#### getNumInstructions

    public int getNumInstructions()

#### getChildBlocks

    public ArrayList<ProgramBlock> getChildBlocks()

Description copied from class: `ProgramBlock`
Get the list of child program blocks if nested; otherwise this method returns null.

Specified by:
  `getChildBlocks` in class `ProgramBlock`
Returns:
  list of program blocks

#### isNested

    public boolean isNested()

Description copied from class: `ProgramBlock`
Indicates if the program block is nested, i.e., if it contains other program blocks (e.g., loops).

Specified by:
  `isNested` in class `ProgramBlock`
Returns:
  true if nested

#### execute

    public void execute​(ExecutionContext ec)

Description copied from class: `ProgramBlock`
Executes this program block (incl recompilation if required).

Specified by:
  `execute` in class `ProgramBlock`
Parameters:
  `ec` - execution context