public class LineCoverageInfo extends java.lang.Object implements java.io.Serializable
| Constructor and Description |
|---|
LineCoverageInfo(boolean isMethodAccurate)
Constructor with a default timestamp.
|
LineCoverageInfo(long timestamp,
boolean isMethodAccurate)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(LineCoverageInfo coverageInfo)
Adds all coverage information from another
LineCoverageInfo. |
void |
addLineCoverage(java.util.Collection<java.lang.Integer> lines,
ELineCoverage coverage)
Adds the coverage information for the given lines.
|
void |
addLineCoverage(int line,
ELineCoverage coverage)
Adds the coverage information for the given line.
|
void |
addLineCoverage(java.util.stream.IntStream lines,
ELineCoverage coverage)
Adds the coverage information for the given lines.
|
LineCoverageInfo |
createStableCopy()
Creates a copy of this object that is stable in regards to serialization, as
it creates the
fullyCoveredLines, partiallyCoveredLines and
uncoveredLines sets by adding the respective entries in a sorted
manner. |
void |
extendCoverageToStatements(java.util.Collection<ShallowEntity> coverableEntities)
Extends coverage to full entities by using the best covered line for all
lines of an entity.
|
java.util.Set<java.lang.Integer> |
getAllCoverableLines()
Returns the set of all lines in the coverage report.
|
int |
getCoverableLines()
Returns the number of lines that are coverable.
|
double |
getCoverageRatio()
Returns the line coverage ratio as a double ([0..1]).
|
double |
getCoveredLines()
Returns the number of lines that are covered or partially covered.
|
java.util.List<java.lang.Integer> |
getFullyCoveredLines()
Returns list of fully covered lines (sorted ascending)
|
ELineCoverage |
getLineCoverage(int line)
Returns the line coverage for the given line or
null if none is
stored. |
java.util.List<java.lang.Integer> |
getPartiallyCoveredLines()
Returns list of partially covered lines (sorted ascending)
|
long |
getTimestamp() |
java.util.List<java.lang.Integer> |
getUncoveredLines()
Returns list of uncovered lines (sorted ascending)
|
boolean |
isMethodAccurate() |
void |
removeLineCoverageInfo(int line)
Removes all previously stored line coverage for the given line.
|
void |
setCoverableLines(java.util.Set<java.lang.Integer> lines)
Replaces the coverable lines with the given lines.
|
void |
setMethodAccurate(boolean isMethodAccurate) |
void |
setTimestamp(long timestamp) |
java.lang.String |
toLineString()
Returns a string representation of the covered/uncovered lines.
|
java.lang.String |
toString() |
public LineCoverageInfo(boolean isMethodAccurate)
public LineCoverageInfo(long timestamp, boolean isMethodAccurate)
public boolean isMethodAccurate()
isMethodAccuratepublic void setMethodAccurate(boolean isMethodAccurate)
isMethodAccuratepublic void addLineCoverage(int line, ELineCoverage coverage)
public void addLineCoverage(java.util.Collection<java.lang.Integer> lines, ELineCoverage coverage)
addLineCoverage(int, ELineCoverage)public void addLineCoverage(java.util.stream.IntStream lines, ELineCoverage coverage)
addLineCoverage(int, ELineCoverage)public void removeLineCoverageInfo(int line)
public void addAll(LineCoverageInfo coverageInfo)
LineCoverageInfo.public ELineCoverage getLineCoverage(int line)
null if none is
stored.public java.util.List<java.lang.Integer> getFullyCoveredLines()
public java.util.List<java.lang.Integer> getPartiallyCoveredLines()
public java.util.List<java.lang.Integer> getUncoveredLines()
public double getCoverageRatio()
public double getCoveredLines()
public int getCoverableLines()
public java.util.Set<java.lang.Integer> getAllCoverableLines()
public long getTimestamp()
timestamppublic void setTimestamp(long timestamp)
timestamppublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toLineString()
public void setCoverableLines(java.util.Set<java.lang.Integer> lines)
fullyCoveredLines and partiallyCoveredLines by removing all
lines that are not coverable.public LineCoverageInfo createStableCopy()
fullyCoveredLines, partiallyCoveredLines and
uncoveredLines sets by adding the respective entries in a sorted
manner.
This is somewhat of a hack,as this relies on java sets always turning out the
same, if the entries are inserted in the same order.public void extendCoverageToStatements(java.util.Collection<ShallowEntity> coverableEntities)