Class ProbeCounter

java.lang.Object
org.objectweb.asm.ClassVisitor
org.jacoco.core.internal.flow.ClassProbesVisitor
org.jacoco.core.internal.instr.ProbeCounter

class ProbeCounter extends ClassProbesVisitor
Internal class to remember the total number of probes required for a class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
     
    private boolean
     

    Fields inherited from class org.objectweb.asm.ClassVisitor

    api, cv
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) int
     
    (package private) boolean
     
    visitMethod(int access, String name, String desc, String signature, String[] exceptions)
    When visiting a method we need a MethodProbesVisitor to handle the probes of that method.
    void
    Reports the total number of encountered probes.

    Methods inherited from class org.objectweb.asm.ClassVisitor

    getDelegate, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • count

      private int count
    • methods

      private boolean methods
  • Constructor Details

    • ProbeCounter

      ProbeCounter()
  • Method Details

    • visitMethod

      public MethodProbesVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
      Description copied from class: ClassProbesVisitor
      When visiting a method we need a MethodProbesVisitor to handle the probes of that method.
      Specified by:
      visitMethod in class ClassProbesVisitor
    • visitTotalProbeCount

      public void visitTotalProbeCount(int count)
      Description copied from class: ClassProbesVisitor
      Reports the total number of encountered probes. For classes this method is called just before ClassVisitor.visitEnd(). For interfaces this method is called before the first method (the static initializer) is emitted.
      Specified by:
      visitTotalProbeCount in class ClassProbesVisitor
      Parameters:
      count - total number of probes
    • getCount

      int getCount()
    • hasMethods

      boolean hasMethods()
      Returns:
      true if the class has non-abstract methods other than a static initializer