org.jacoco.core.analysis
Class LinesImpl

java.lang.Object
  extended by org.jacoco.core.analysis.AbstractCounter
      extended by org.jacoco.core.analysis.LinesImpl
All Implemented Interfaces:
ICounter, ILines

public class LinesImpl
extends AbstractCounter
implements ILines

ILines implementation.

Version:
$Revision: $
Author:
Marc R. Hoffmann

Field Summary
 
Fields inherited from class org.jacoco.core.analysis.AbstractCounter
covered, total
 
Fields inherited from interface org.jacoco.core.analysis.ILines
FULLY_COVERED, NO_CODE, NOT_COVERED, PARTLY_COVERED
 
Constructor Summary
LinesImpl()
          Creates an empty line counter.
LinesImpl(int[] lines, boolean covered)
          Created a line counter with the given lines
 
Method Summary
 int getFirstLine()
          The number of the first line coverage information is available for.
 int getLastLine()
          The number of the last line coverage information is available for.
 byte getStatus(int line)
          Returns the coverage status of the given line.
 void increment(ILines counter)
          Adds the lines of the given line counter.
 void increment(int[] lines, boolean covered)
          Adds the given lines as fully covered or not covered.
 
Methods inherited from class org.jacoco.core.analysis.AbstractCounter
equals, getCoveredCount, getCoveredRatio, getNotCoveredCount, getNotCoveredRatio, getTotalCount, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jacoco.core.analysis.ICounter
getCoveredCount, getCoveredRatio, getNotCoveredCount, getNotCoveredRatio, getTotalCount
 

Constructor Detail

LinesImpl

public LinesImpl()
Creates an empty line counter.


LinesImpl

public LinesImpl(int[] lines,
                 boolean covered)
Created a line counter with the given lines

Parameters:
lines - line numbers to add
covered - true if all lines are covered
Method Detail

increment

public void increment(int[] lines,
                      boolean covered)
Adds the given lines as fully covered or not covered.

Parameters:
lines - line numbers to add
covered - true if all lines are covered

increment

public void increment(ILines counter)
Adds the lines of the given line counter. The states are updated accordingly.

Parameters:
counter - line counter to add

getFirstLine

public int getFirstLine()
Description copied from interface: ILines
The number of the first line coverage information is available for. If no line is yet contained, the method returns -1.

Specified by:
getFirstLine in interface ILines
Returns:
number of the first line or -1

getLastLine

public int getLastLine()
Description copied from interface: ILines
The number of the last line coverage information is available for. If no line is yet contained, the method returns -1.

Specified by:
getLastLine in interface ILines
Returns:
number of the last line or -1

getStatus

public byte getStatus(int line)
Description copied from interface: ILines
Returns the coverage status of the given line.

Specified by:
getStatus in interface ILines
Parameters:
line - number of the line in question
Returns:
status of this line
See Also:
ILines.NO_CODE, ILines.NOT_COVERED, ILines.PARTLY_COVERED, ILines.FULLY_COVERED