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 intconditions()NewCoverageconditions(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()intcoveredConditions()java.util.SortedMap<java.lang.Integer,java.lang.Integer>coveredConditionsByLine()intcoveredLines()voiddoSave()java.util.SortedMap<java.lang.Integer,java.lang.Integer>hitsByLine()InputFileinputFile()NewCoveragelineHits(int line, int hits)Call this method as many time as needed to report coverage hits per line.intlinesToCover()NewCoverageofType(CoverageType type)DefaultCoverageonFile(InputFile inputFile)The covered file.CoverageTypetype()-
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:NewCoverageThe covered file.- Specified by:
onFilein interfaceNewCoverage
-
inputFile
public InputFile inputFile()
-
ofType
public NewCoverage ofType(CoverageType type)
- Specified by:
ofTypein interfaceNewCoverage
-
type
public CoverageType type()
-
lineHits
public NewCoverage lineHits(int line, int hits)
Description copied from interface:NewCoverageCall this method as many time as needed to report coverage hits per line. This method should only be called for executable lines.- Specified by:
lineHitsin 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:NewCoverageCall this method as many time as needed to report coverage of conditions.- Specified by:
conditionsin 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:
doSavein classDefaultStorable
-
-