Class ClassCoverageImpl
- java.lang.Object
-
- org.jacoco.core.analysis.CoverageNodeImpl
-
- org.jacoco.core.internal.analysis.SourceNodeImpl
-
- org.jacoco.core.internal.analysis.ClassCoverageImpl
-
- All Implemented Interfaces:
IClassCoverage
,ICoverageNode
,ISourceNode
public class ClassCoverageImpl extends SourceNodeImpl implements IClassCoverage
Implementation ofIClassCoverage
.
-
-
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 long
id
private java.lang.String[]
interfaces
private java.util.Collection<IMethodCoverage>
methods
private boolean
noMatch
private java.lang.String
signature
private java.lang.String
sourceFileName
private java.lang.String
superName
-
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 ClassCoverageImpl(java.lang.String name, long id, boolean noMatch)
Creates a class coverage data object with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMethod(IMethodCoverage method)
Add a method to this class.long
getId()
Returns the identifier for this class which is the CRC64 signature of the class definition.java.lang.String[]
getInterfaceNames()
Returns the VM names of implemented/extended interfaces.java.util.Collection<IMethodCoverage>
getMethods()
Returns the methods included in this class.java.lang.String
getPackageName()
Returns the VM name of the package this class belongs to.java.lang.String
getSignature()
Returns the VM signature of the class.java.lang.String
getSourceFileName()
Returns the optional name of the corresponding source file.java.lang.String
getSuperName()
Returns the VM name of the superclass.boolean
isNoMatch()
Returns if the the analyzed class does match the execution data provided.void
setInterfaces(java.lang.String[] interfaces)
Sets the VM names of implemented/extended interfaces.void
setSignature(java.lang.String signature)
Sets the VM signature of the class.void
setSourceFileName(java.lang.String sourceFileName)
Sets the name of the corresponding source file for this class.void
setSuperName(java.lang.String superName)
Sets the VM name of the superclass.-
Methods inherited from class org.jacoco.core.internal.analysis.SourceNodeImpl
ensureCapacity, getFirstLine, getLastLine, getLine, increment, 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
-
-
-
-
Field Detail
-
id
private final long id
-
noMatch
private final boolean noMatch
-
methods
private final java.util.Collection<IMethodCoverage> methods
-
signature
private java.lang.String signature
-
superName
private java.lang.String superName
-
interfaces
private java.lang.String[] interfaces
-
sourceFileName
private java.lang.String sourceFileName
-
-
Constructor Detail
-
ClassCoverageImpl
public ClassCoverageImpl(java.lang.String name, long id, boolean noMatch)
Creates a class coverage data object with the given parameters.- Parameters:
name
- VM name of the classid
- class identifiernoMatch
-true
, if class id does not match with execution data
-
-
Method Detail
-
addMethod
public void addMethod(IMethodCoverage method)
Add a method to this class.- Parameters:
method
- method data to add
-
setSignature
public void setSignature(java.lang.String signature)
Sets the VM signature of the class.- Parameters:
signature
- VM signature of the class (may benull
)
-
setSuperName
public void setSuperName(java.lang.String superName)
Sets the VM name of the superclass.- Parameters:
superName
- VM name of the super class (may benull
, i.e.java/lang/Object
)
-
setInterfaces
public void setInterfaces(java.lang.String[] interfaces)
Sets the VM names of implemented/extended interfaces.- Parameters:
interfaces
- VM names of implemented/extended interfaces
-
setSourceFileName
public void setSourceFileName(java.lang.String sourceFileName)
Sets the name of the corresponding source file for this class.- Parameters:
sourceFileName
- name of the source file
-
getId
public long getId()
Description copied from interface:IClassCoverage
Returns the identifier for this class which is the CRC64 signature of the class definition.- Specified by:
getId
in interfaceIClassCoverage
- Returns:
- class identifier
-
isNoMatch
public boolean isNoMatch()
Description copied from interface:IClassCoverage
Returns if the the analyzed class does match the execution data provided. More precisely if execution data is available for a class with the same qualified name but with a different class id.- Specified by:
isNoMatch
in interfaceIClassCoverage
- Returns:
true
if this class does not match to the provided execution data.
-
getSignature
public java.lang.String getSignature()
Description copied from interface:IClassCoverage
Returns the VM signature of the class.- Specified by:
getSignature
in interfaceIClassCoverage
- Returns:
- VM signature of the class (may be
null
)
-
getSuperName
public java.lang.String getSuperName()
Description copied from interface:IClassCoverage
Returns the VM name of the superclass.- Specified by:
getSuperName
in interfaceIClassCoverage
- Returns:
- VM name of the super class (may be
null
, i.e.java/lang/Object
)
-
getInterfaceNames
public java.lang.String[] getInterfaceNames()
Description copied from interface:IClassCoverage
Returns the VM names of implemented/extended interfaces.- Specified by:
getInterfaceNames
in interfaceIClassCoverage
- Returns:
- VM names of implemented/extended interfaces
-
getPackageName
public java.lang.String getPackageName()
Description copied from interface:IClassCoverage
Returns the VM name of the package this class belongs to.- Specified by:
getPackageName
in interfaceIClassCoverage
- Returns:
- VM name of the package
-
getSourceFileName
public java.lang.String getSourceFileName()
Description copied from interface:IClassCoverage
Returns the optional name of the corresponding source file.- Specified by:
getSourceFileName
in interfaceIClassCoverage
- Returns:
- name of the corresponding source file
-
getMethods
public java.util.Collection<IMethodCoverage> getMethods()
Description copied from interface:IClassCoverage
Returns the methods included in this class.- Specified by:
getMethods
in interfaceIClassCoverage
- Returns:
- methods of this class
-
-