com.jcoverage.coverage
Class InstrumentationImpl
java.lang.Object
com.jcoverage.coverage.InstrumentationImpl
- All Implemented Interfaces:
- HasBeenInstrumented, Instrumentation, InstrumentationInternal, java.io.Serializable
- class InstrumentationImpl
- extends java.lang.Object
- implements InstrumentationInternal, HasBeenInstrumented
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
logger
static final transient org.apache.log4j.Logger logger
ZERO
static final transient java.lang.Long ZERO
lineCounts
final java.util.Map lineCounts
sourceLineNumbers
final java.util.Set sourceLineNumbers
sourceLineNumbersByMethod
final java.util.Map sourceLineNumbersByMethod
conditionalsByMethod
final java.util.Map conditionalsByMethod
methodNamesAndSignatures
final java.util.Set methodNamesAndSignatures
linesOfCode
int linesOfCode
sourceFileName
java.lang.String sourceFileName
InstrumentationImpl
InstrumentationImpl()
getCoverage
public java.util.Map getCoverage()
- Specified by:
getCoverage
in interface Instrumentation
- Returns:
- a sorted coverage mapping from source line to number of
hits.
getCoverage
public long getCoverage(int lineNumber)
- Specified by:
getCoverage
in interface Instrumentation
- Parameters:
lineNumber
- the source code line number.
- Returns:
- the number of hits a particular line of code has.
touch
public void touch(int lineNumber)
- Description copied from interface:
Instrumentation
- Increment the number of hits for a particular line of code.
- Specified by:
touch
in interface Instrumentation
- Parameters:
lineNumber
- the line of code to increment the number of hits.
merge
public void merge(Instrumentation instrumentation)
- Description copied from interface:
Instrumentation
- Merge some existing instrumentation with this instrumentation.
- Specified by:
merge
in interface Instrumentation
- Parameters:
instrumentation
- some existing instrumentation.
getSourceLineNumbers
public java.util.Set getSourceLineNumbers()
- Specified by:
getSourceLineNumbers
in interface Instrumentation
- Returns:
- the set of valid source line numbers
setSourceLineNumbers
public void setSourceLineNumbers(java.util.Set sourceLineNumbers)
- Specified by:
setSourceLineNumbers
in interface InstrumentationInternal
- Parameters:
sourceLineNumbers
- the set of valid source line numbers.
getLineCoverageRate
public double getLineCoverageRate()
- Specified by:
getLineCoverageRate
in interface Instrumentation
- Returns:
- the line coverage rate for the class
getBranchCoverageRate
public double getBranchCoverageRate()
- Specified by:
getBranchCoverageRate
in interface Instrumentation
- Returns:
- the branch coverage rate for the class
getLineCoverageRate
public double getLineCoverageRate(java.lang.String methodNameAndSignature)
- Specified by:
getLineCoverageRate
in interface Instrumentation
- Returns:
- the line coverage rate for particular method
getTouchedLines
java.util.Set getTouchedLines(java.lang.String methodNameAndSignature)
getBranchCoverageRate
public double getBranchCoverageRate(java.lang.String methodNameAndSignature)
- Specified by:
getBranchCoverageRate
in interface Instrumentation
- Returns:
- the branch coverage rate for a particular method
findNextSourceLineAfter
java.lang.Integer findNextSourceLineAfter(java.lang.String methodNameAndSignature,
int thisOne)
setSourceFileName
public void setSourceFileName(java.lang.String sourceFileName)
- Specified by:
setSourceFileName
in interface InstrumentationInternal
- Parameters:
sourceFileName
- the source file name.
getSourceFileName
public java.lang.String getSourceFileName()
- Specified by:
getSourceFileName
in interface Instrumentation
- Returns:
- the source file name.
getSourceLineNumbersByMethod
public java.util.Map getSourceLineNumbersByMethod()
setSourceLineNumbersByMethod
public void setSourceLineNumbersByMethod(java.util.Map sourceLineNumbersByMethod)
- Specified by:
setSourceLineNumbersByMethod
in interface InstrumentationInternal
getConditionalsByMethod
public java.util.Map getConditionalsByMethod()
setConditionalsByMethod
public void setConditionalsByMethod(java.util.Map conditionalsByMethod)
- Specified by:
setConditionalsByMethod
in interface InstrumentationInternal
getMethodNamesAndSignatures
public java.util.Set getMethodNamesAndSignatures()
- Specified by:
getMethodNamesAndSignatures
in interface Instrumentation
- Returns:
- the method name and signature of each method found in the
class represented by this instrumentation.
setMethodNamesAndSignatures
public void setMethodNamesAndSignatures(java.util.Set x)
- Specified by:
setMethodNamesAndSignatures
in interface InstrumentationInternal