Class ClassCoverageImpl

All Implemented Interfaces:
IClassCoverage, ICoverageNode, ISourceNode

public class ClassCoverageImpl extends SourceNodeImpl implements IClassCoverage
Implementation of IClassCoverage.
  • Field Details

    • id

      private final long id
    • noMatch

      private final boolean noMatch
    • methods

      private final Collection<IMethodCoverage> methods
    • signature

      private String signature
    • superName

      private String superName
    • interfaces

      private String[] interfaces
    • sourceFileName

      private String sourceFileName
  • Constructor Details

    • ClassCoverageImpl

      public ClassCoverageImpl(String name, long id, boolean noMatch)
      Creates a class coverage data object with the given parameters.
      Parameters:
      name - VM name of the class
      id - class identifier
      noMatch - true, if class id does not match with execution data
  • Method Details

    • addMethod

      public void addMethod(IMethodCoverage method)
      Add a method to this class.
      Parameters:
      method - method data to add
    • setSignature

      public void setSignature(String signature)
      Sets the VM signature of the class.
      Parameters:
      signature - VM signature of the class (may be null)
    • setSuperName

      public void setSuperName(String superName)
      Sets the VM name of the superclass.
      Parameters:
      superName - VM name of the super class (may be null, i.e. java/lang/Object)
    • setInterfaces

      public void setInterfaces(String[] interfaces)
      Sets the VM names of implemented/extended interfaces.
      Parameters:
      interfaces - VM names of implemented/extended interfaces
    • setSourceFileName

      public void setSourceFileName(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 interface IClassCoverage
      Returns:
      class identifier
    • isNoMatch

      public boolean isNoMatch()
      Description copied from interface: IClassCoverage
      Returns 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:
      isNoMatch in interface IClassCoverage
      Returns:
      true if this class does not match to the provided execution data.
    • getSignature

      public String getSignature()
      Description copied from interface: IClassCoverage
      Returns the VM signature of the class.
      Specified by:
      getSignature in interface IClassCoverage
      Returns:
      VM signature of the class (may be null)
    • getSuperName

      public String getSuperName()
      Description copied from interface: IClassCoverage
      Returns the VM name of the superclass.
      Specified by:
      getSuperName in interface IClassCoverage
      Returns:
      VM name of the super class (may be null, i.e. java/lang/Object)
    • getInterfaceNames

      public String[] getInterfaceNames()
      Description copied from interface: IClassCoverage
      Returns the VM names of implemented/extended interfaces.
      Specified by:
      getInterfaceNames in interface IClassCoverage
      Returns:
      VM names of implemented/extended interfaces
    • getPackageName

      public String getPackageName()
      Description copied from interface: IClassCoverage
      Returns the VM name of the package this class belongs to.
      Specified by:
      getPackageName in interface IClassCoverage
      Returns:
      VM name of the package
    • getSourceFileName

      public String getSourceFileName()
      Description copied from interface: IClassCoverage
      Returns the optional name of the corresponding source file.
      Specified by:
      getSourceFileName in interface IClassCoverage
      Returns:
      name of the corresponding source file
    • getMethods

      public Collection<IMethodCoverage> getMethods()
      Description copied from interface: IClassCoverage
      Returns the methods included in this class.
      Specified by:
      getMethods in interface IClassCoverage
      Returns:
      methods of this class