| com.pnfsoftware.jeb.core.units.code.java.IJavaIf |
Java AST interface to represent conditional "if" statements.
An if-statement consists of one or more branches (if, else-if) followed by an optional default branch (else) block.
Example:
if(p) b else if(p1) b1 else b2
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract IJavaBlock |
getBranchBody(int index)
Get a branch (if, else-if) body.
| ||||||||||
| abstract IJavaPredicate |
getBranchPredicate(int index)
Get a branch (if, else-if) predicate.
| ||||||||||
| abstract IJavaBlock |
getDefaultBlock()
Get the default branch (else) body, if any.
| ||||||||||
| abstract void |
insertBranch(int index, IJavaPredicate p, IJavaBlock b)
Insert a branch (if, else-if) to this statement.
| ||||||||||
| abstract void |
removeBranch(int index)
Remove a branch from this statement.
| ||||||||||
| abstract void |
setBranchBody(int index, IJavaBlock b)
Set a branch (if, else-if) body.
| ||||||||||
| abstract void |
setBranchPredicate(int index, IJavaPredicate p)
Set a branch (if, else-if) predicate.
| ||||||||||
| abstract int |
size()
Get the number of branches, including the default (else) branch, if any.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.units.code.java.ICompound
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.code.java.IJavaElement
| |||||||||||
Get a branch (if, else-if) body.
| index | 0-based branch index (0 for 'if', 1... for subsequent else-ifs) |
|---|
Get a branch (if, else-if) predicate.
| index | 0-based branch index (0 for 'if', 1... for subsequent else-ifs) |
|---|
Get the default branch (else) body, if any.
Insert a branch (if, else-if) to this statement.
| index | 0-based branch index |
|---|---|
| p | mandatory predicate |
| b | mandatory body |
Remove a branch from this statement.
| index | 0-based branch index |
|---|
Set a branch (if, else-if) body.
| index | 0-based branch index |
|---|---|
| b | mandatory body |
Set a branch (if, else-if) predicate.
| index | 0-based branch index |
|---|---|
| p | mandatory predicate |
Get the number of branches, including the default (else) branch, if any.