Class DefaultCoverage
- java.lang.Object
-
- org.sonar.api.batch.sensor.internal.DefaultStorable
-
- org.sonar.api.batch.sensor.coverage.internal.DefaultCoverage
-
- All Implemented Interfaces:
NewCoverage
public class DefaultCoverage extends DefaultStorable implements NewCoverage
-
-
Field Summary
-
Fields inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
storage
-
-
Constructor Summary
Constructors Constructor Description DefaultCoverage()
DefaultCoverage(SensorStorage storage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
conditions()
NewCoverage
conditions(int line, int conditions, int coveredConditions)
Call this method as many time as needed to report coverage of conditions.java.util.SortedMap<java.lang.Integer,java.lang.Integer>
conditionsByLine()
int
coveredConditions()
java.util.SortedMap<java.lang.Integer,java.lang.Integer>
coveredConditionsByLine()
int
coveredLines()
void
doSave()
java.util.SortedMap<java.lang.Integer,java.lang.Integer>
hitsByLine()
InputFile
inputFile()
NewCoverage
lineHits(int line, int hits)
Call this method as many time as needed to report coverage hits per line.int
linesToCover()
NewCoverage
ofType(CoverageType type)
DefaultCoverage
onFile(InputFile inputFile)
The covered file.CoverageType
type()
-
Methods inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
save, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.sonar.api.batch.sensor.coverage.NewCoverage
save
-
-
-
-
Constructor Detail
-
DefaultCoverage
public DefaultCoverage()
-
DefaultCoverage
public DefaultCoverage(@Nullable SensorStorage storage)
-
-
Method Detail
-
onFile
public DefaultCoverage onFile(InputFile inputFile)
Description copied from interface:NewCoverage
The covered file.- Specified by:
onFile
in interfaceNewCoverage
-
inputFile
public InputFile inputFile()
-
ofType
public NewCoverage ofType(CoverageType type)
- Specified by:
ofType
in interfaceNewCoverage
-
type
public CoverageType type()
-
lineHits
public NewCoverage lineHits(int line, int hits)
Description copied from interface:NewCoverage
Call this method as many time as needed to report coverage hits per line. This method should only be called for executable lines.- Specified by:
lineHits
in interfaceNewCoverage
- Parameters:
line
- Line number (starts at 1).hits
- Number of time the line was hit.
-
conditions
public NewCoverage conditions(int line, int conditions, int coveredConditions)
Description copied from interface:NewCoverage
Call this method as many time as needed to report coverage of conditions.- Specified by:
conditions
in interfaceNewCoverage
- Parameters:
line
- Line number (starts at 1).conditions
- Number of conditions on this line (should be greater than 1).coveredConditions
- Number of covered conditions.
-
coveredLines
public int coveredLines()
-
linesToCover
public int linesToCover()
-
conditions
public int conditions()
-
coveredConditions
public int coveredConditions()
-
hitsByLine
public java.util.SortedMap<java.lang.Integer,java.lang.Integer> hitsByLine()
-
conditionsByLine
public java.util.SortedMap<java.lang.Integer,java.lang.Integer> conditionsByLine()
-
coveredConditionsByLine
public java.util.SortedMap<java.lang.Integer,java.lang.Integer> coveredConditionsByLine()
-
doSave
public void doSave()
- Specified by:
doSave
in classDefaultStorable
-
-