org.jacoco.core.internal.flow

## Class Instruction

- java.lang.Object
- - org.jacoco.core.internal.flow.Instruction

    public class Instruction
    extends Object

Representation of a byte code instruction for analysis. Internally used for analysis.

### Constructor Summary

Constructors
Constructor and Description
`Instruction(int line)` New instruction at the given line.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addBranch()` Adds an branch to this instruction.
`int` `getBranches()` Returns the total number of branches starting from this instruction.
`int` `getCoveredBranches()` Returns the number of covered branches starting from this instruction.
`int` `getLine()` Returns the source line this instruction belongs to.
`void` `setCovered()` Marks one branch of this instruction as covered.
`void` `setPredecessor(Instruction predecessor)` Sets the given instruction as a predecessor of this instruction.

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

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

### Constructor Detail

#### Instruction

    public Instruction(int line)

New instruction at the given line.

Parameters:
  `line` - source line this instruction belongs to

### Method Detail

#### addBranch

    public void addBranch()

Adds an branch to this instruction.

#### setPredecessor

    public void setPredecessor(Instruction predecessor)

Sets the given instruction as a predecessor of this instruction. This will add an branch to the predecessor.

Parameters:
  `predecessor` - predecessor instruction
See Also:
  `addBranch()`

#### setCovered

    public void setCovered()

Marks one branch of this instruction as covered. Also recursively marks all predecessor instructions as covered if this is the first covered branch.

#### getLine

    public int getLine()

Returns the source line this instruction belongs to.

Returns:
  corresponding source line

#### getBranches

    public int getBranches()

Returns the total number of branches starting from this instruction.

Returns:
  total number of branches

#### getCoveredBranches

    public int getCoveredBranches()

Returns the number of covered branches starting from this instruction.

Returns:
  number of covered branches