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 longidprivate java.lang.String[]interfacesprivate java.util.Collection<IMethodCoverage>methodsprivate booleannoMatchprivate java.lang.Stringsignatureprivate java.lang.StringsourceFileNameprivate java.lang.StringsuperName-
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 voidaddMethod(IMethodCoverage method)Add a method to this class.longgetId()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.StringgetPackageName()Returns the VM name of the package this class belongs to.java.lang.StringgetSignature()Returns the VM signature of the class.java.lang.StringgetSourceFileName()Returns the optional name of the corresponding source file.java.lang.StringgetSuperName()Returns the VM name of the superclass.booleanisNoMatch()Returns if the analyzed class does match the execution data provided.voidsetInterfaces(java.lang.String[] interfaces)Sets the VM names of implemented/extended interfaces.voidsetSignature(java.lang.String signature)Sets the VM signature of the class.voidsetSourceFileName(java.lang.String sourceFileName)Sets the name of the corresponding source file for this class.voidsetSuperName(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:IClassCoverageReturns the identifier for this class which is the CRC64 signature of the class definition.- Specified by:
getIdin interfaceIClassCoverage- Returns:
- class identifier
-
isNoMatch
public boolean isNoMatch()
Description copied from interface:IClassCoverageReturns if 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:
isNoMatchin interfaceIClassCoverage- Returns:
trueif this class does not match to the provided execution data.
-
getSignature
public java.lang.String getSignature()
Description copied from interface:IClassCoverageReturns the VM signature of the class.- Specified by:
getSignaturein interfaceIClassCoverage- Returns:
- VM signature of the class (may be
null)
-
getSuperName
public java.lang.String getSuperName()
Description copied from interface:IClassCoverageReturns the VM name of the superclass.- Specified by:
getSuperNamein 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:IClassCoverageReturns the VM names of implemented/extended interfaces.- Specified by:
getInterfaceNamesin interfaceIClassCoverage- Returns:
- VM names of implemented/extended interfaces
-
getPackageName
public java.lang.String getPackageName()
Description copied from interface:IClassCoverageReturns the VM name of the package this class belongs to.- Specified by:
getPackageNamein interfaceIClassCoverage- Returns:
- VM name of the package
-
getSourceFileName
public java.lang.String getSourceFileName()
Description copied from interface:IClassCoverageReturns the optional name of the corresponding source file.- Specified by:
getSourceFileNamein interfaceIClassCoverage- Returns:
- name of the corresponding source file
-
getMethods
public java.util.Collection<IMethodCoverage> getMethods()
Description copied from interface:IClassCoverageReturns the methods included in this class.- Specified by:
getMethodsin interfaceIClassCoverage- Returns:
- methods of this class
-
-