Modifier and Type | Method and Description |
---|---|
void |
add(Statement stm)
Append a statement to this block.
|
static Block |
build()
Create a new block.
|
Statement |
get(int index)
Get the statement at a given index.
|
void |
insert(int index,
Statement stm)
Insert a statement at the given index.
|
Statement |
remove(int index)
Pull a statement from the block.
|
void |
set(int index,
Statement stm)
Replace a statement by another statement.
|
int |
size()
Get the number of statements in this block.
|
attachTag, getSubElements, isCompound, replaceSubElement, retrieveTag
public static Block build()
Create a new block. After creation, the block is empty.
public int size()
Get the number of statements in this block.
public Statement get(int index)
Get the statement at a given index.
index
- 0-based statement indexpublic void set(int index, Statement stm)
Replace a statement by another statement.
index
- 0-based statement indexstm
- mandatory statementpublic Statement remove(int index)
Pull a statement from the block.
index
- 0-based statement indexpublic void add(Statement stm)
Append a statement to this block.
stm
- mandatory statement to be appendedpublic void insert(int index, Statement stm)
Insert a statement at the given index.
index
- 0-based statement indexstm
- mandatory statement to be inserted