|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jacoco.core.internal.analysis.Instruction
public class Instruction
Execution status of a single bytecode instruction internally used for coverage analysis. The execution status is recorded separately for each outgoing branch. Each instruction has at least one branch, for example in case of a simple sequence of instructions (by convention branch 0). Instances of this class are used in two steps:
Instruction instance is
created. In correspondence with the CFG these instances are linked with each
other with the addBranch() methods. The executions status is
either directly derived from a probe which has been inserted in the execution
flow (addBranch(boolean, int)) or indirectly propagated along the
CFG edges (addBranch(Instruction, int)).
Instruction
instances and do not modify the existing ones.
| Constructor Summary | |
|---|---|
Instruction(int line)
New instruction at the given line. |
|
| Method Summary | |
|---|---|
void |
addBranch(boolean executed,
int branch)
Adds a branch to this instruction which execution status is directly derived from a probe. |
void |
addBranch(Instruction target,
int branch)
Adds a branch to this instruction which execution status is indirectly derived from the execution status of the target instruction. |
ICounter |
getBranchCounter()
Returns the branch coverage counter of this instruction. |
ICounter |
getInstructionCounter()
Returns the instruction coverage counter of this instruction. |
int |
getLine()
Returns the source line this instruction belongs to. |
Instruction |
merge(Instruction other)
Merges information about covered branches of this instruction with another instruction. |
Instruction |
replaceBranches(Collection<Instruction> newBranches)
Creates a copy of this instruction where all outgoing branches are replaced with the given instructions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Instruction(int line)
line - source line this instruction belongs to| Method Detail |
|---|
public void addBranch(Instruction target,
int branch)
target - target instruction of this branchbranch - branch identifier unique for this instruction
public void addBranch(boolean executed,
int branch)
executed - whether the corresponding probe has been executedbranch - branch identifier unique for this instructionpublic int getLine()
public Instruction merge(Instruction other)
other - instruction to merge with
public Instruction replaceBranches(Collection<Instruction> newBranches)
newBranches - new branches to consider
public ICounter getInstructionCounter()
public ICounter getBranchCounter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||