Class MethodCoverageImpl
- java.lang.Object
-
- org.jacoco.core.analysis.CoverageNodeImpl
-
- org.jacoco.core.internal.analysis.SourceNodeImpl
-
- org.jacoco.core.internal.analysis.MethodCoverageImpl
-
- All Implemented Interfaces:
ICoverageNode
,IMethodCoverage
,ISourceNode
public class MethodCoverageImpl extends SourceNodeImpl implements IMethodCoverage
Implementation ofIMethodCoverage
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jacoco.core.analysis.ICoverageNode
ICoverageNode.CounterEntity, ICoverageNode.ElementType
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
desc
private java.lang.String
signature
-
Fields inherited from class org.jacoco.core.analysis.CoverageNodeImpl
branchCounter, classCounter, complexityCounter, instructionCounter, lineCounter, methodCounter
-
Fields inherited from interface org.jacoco.core.analysis.ISourceNode
UNKNOWN_LINE
-
-
Constructor Summary
Constructors Constructor Description MethodCoverageImpl(java.lang.String name, java.lang.String desc, java.lang.String signature)
Creates a method coverage data object with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDesc()
Returns the descriptor of the method.java.lang.String
getSignature()
Returns the generic signature of the method if defined.void
increment(ICounter instructions, ICounter branches, int line)
Increments instructions and branches by the given counter values.void
incrementMethodCounter()
This method must be called exactly once after all instructions and branches have been incremented for this method coverage node.-
Methods inherited from class org.jacoco.core.internal.analysis.SourceNodeImpl
ensureCapacity, getFirstLine, getLastLine, getLine, increment
-
Methods inherited from class org.jacoco.core.analysis.CoverageNodeImpl
containsCode, getBranchCounter, getClassCounter, getComplexityCounter, getCounter, getElementType, getInstructionCounter, getLineCounter, getMethodCounter, getName, getPlainCopy, increment, increment, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jacoco.core.analysis.ICoverageNode
containsCode, getBranchCounter, getClassCounter, getComplexityCounter, getCounter, getElementType, getInstructionCounter, getLineCounter, getMethodCounter, getName, getPlainCopy
-
Methods inherited from interface org.jacoco.core.analysis.ISourceNode
getFirstLine, getLastLine, getLine
-
-
-
-
Constructor Detail
-
MethodCoverageImpl
public MethodCoverageImpl(java.lang.String name, java.lang.String desc, java.lang.String signature)
Creates a method coverage data object with the given parameters.- Parameters:
name
- name of the methoddesc
- method descriptorsignature
- generic signature ornull
-
-
Method Detail
-
increment
public void increment(ICounter instructions, ICounter branches, int line)
Description copied from class:SourceNodeImpl
Increments instructions and branches by the given counter values. If a optional line number is specified the instructions and branches are added to the given line. The line counter is incremented accordingly.- Overrides:
increment
in classSourceNodeImpl
- Parameters:
instructions
- instructions to addbranches
- branches to addline
- optional line number orISourceNode.UNKNOWN_LINE
-
incrementMethodCounter
public void incrementMethodCounter()
This method must be called exactly once after all instructions and branches have been incremented for this method coverage node.
-
getDesc
public java.lang.String getDesc()
Description copied from interface:IMethodCoverage
Returns the descriptor of the method.- Specified by:
getDesc
in interfaceIMethodCoverage
- Returns:
- descriptor
-
getSignature
public java.lang.String getSignature()
Description copied from interface:IMethodCoverage
Returns the generic signature of the method if defined.- Specified by:
getSignature
in interfaceIMethodCoverage
- Returns:
- generic signature or
null
-
-