Class CoverageNodeImpl

    • Field Detail

      • name

        private final java.lang.String name
      • branchCounter

        protected CounterImpl branchCounter
        Counter for branches.
      • instructionCounter

        protected CounterImpl instructionCounter
        Counter for instructions.
      • lineCounter

        protected CounterImpl lineCounter
        Counter for lines
      • complexityCounter

        protected CounterImpl complexityCounter
        Counter for complexity.
      • methodCounter

        protected CounterImpl methodCounter
        Counter for methods.
      • classCounter

        protected CounterImpl classCounter
        Counter for classes.
    • Constructor Detail

      • CoverageNodeImpl

        public CoverageNodeImpl​(ICoverageNode.ElementType elementType,
                                java.lang.String name)
        Creates a new coverage data node.
        Parameters:
        elementType - type of the element represented by this instance
        name - name of this node
    • Method Detail

      • increment

        public void increment​(ICoverageNode child)
        Increments the counters by the values given by another element.
        Parameters:
        child - counters to add
      • increment

        public void increment​(java.util.Collection<? extends ICoverageNode> children)
        Increments the counters by the values given by the collection of elements.
        Parameters:
        children - list of nodes, which counters will be added to this node
      • getName

        public java.lang.String getName()
        Description copied from interface: ICoverageNode
        Returns the name of this node.
        Specified by:
        getName in interface ICoverageNode
        Returns:
        name of this node
      • containsCode

        public boolean containsCode()
        Description copied from interface: ICoverageNode
        Checks whether this node contains code relevant for code coverage.
        Specified by:
        containsCode in interface ICoverageNode
        Returns:
        true if this node contains code relevant for code coverage
      • getPlainCopy

        public ICoverageNode getPlainCopy()
        Description copied from interface: ICoverageNode
        Creates a plain copy of this node. While ICoverageNode implementations may contain heavy data structures, the copy returned by this method is reduced to the counters only. This helps to save memory while processing huge structures.
        Specified by:
        getPlainCopy in interface ICoverageNode
        Returns:
        copy with counters only
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object