com.jcoverage.coverage.reporting.collation
Class JavaFilePage

java.lang.Object
  extended bycom.jcoverage.reporting.AbstractPage
      extended bycom.jcoverage.coverage.reporting.collation.JavaFilePage
All Implemented Interfaces:
Closeable, Page

public class JavaFilePage
extends AbstractPage
implements Page

This class implements a page detailing the coverage results of a single java source file.


Field Summary
(package private)  java.util.SortedSet coverageUnion
          This set is important for ordering all the coverage lines as they come in- the algorithm that highlights uncovered lines is dependent on all the lines being in order.
(package private)  java.util.Set instrumentations
          We can receive multiple instrumentation contributions, since a single java source file can contain multiple classes (although strictly only one of these can be declared public).
(package private) static org.apache.log4j.Logger logger
           
(package private)  JavaFileLine masterLine
          The line that summarizes this detail page.
(package private)  java.util.Set validSourceLines
          We want to know which of the lines are valid, because we don't want to count lines that are impossible to reach (blank lines, braces, import statements, method headers, etc..) in the coverage calculations and highlighting.
 
Fields inherited from class com.jcoverage.reporting.AbstractPage
 
Constructor Summary
JavaFilePage()
           
 
Method Summary
 void addInstrumentation(Instrumentation instrumentation)
          We add instrumentation to this instance, so we can work out which lines are hit and which are not.
 double getBranchCoverageRate()
           
 JavaFileLine getJavaFileLine()
           
 double getLineCoverageRate()
           
 java.util.Set getSourceFileLineCoverageSet()
           
 int getSourceLinesCount()
           
 java.util.Set getValidSourceLines()
           
 void setMasterLine(Line masterLine)
          This method overrides AbstractPage.setMasterLine(com.jcoverage.reporting.Line) so that we have convenient access to our master line, and don't have to constantly cast it.
 
Methods inherited from class com.jcoverage.reporting.AbstractPage
addCategory, addLineReference, close, createLine, getCategories, getLabel, getLines, getMasterLine, instantiateLineForCategory, isClosed, lookupLineByField, setReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jcoverage.reporting.Page
addCategory, addLineReference, createLine, getCategories, getLabel, getLines, getMasterLine, lookupLineByField, setReport
 
Methods inherited from interface com.jcoverage.reporting.Closeable
close, isClosed
 

Field Detail

logger

static org.apache.log4j.Logger logger

instrumentations

java.util.Set instrumentations
We can receive multiple instrumentation contributions, since a single java source file can contain multiple classes (although strictly only one of these can be declared public).


masterLine

JavaFileLine masterLine
The line that summarizes this detail page. We prefer not to duplicate information- it's either in the summary line or in this page, not both.


coverageUnion

java.util.SortedSet coverageUnion
This set is important for ordering all the coverage lines as they come in- the algorithm that highlights uncovered lines is dependent on all the lines being in order.


validSourceLines

java.util.Set validSourceLines
We want to know which of the lines are valid, because we don't want to count lines that are impossible to reach (blank lines, braces, import statements, method headers, etc..) in the coverage calculations and highlighting.

Constructor Detail

JavaFilePage

public JavaFilePage()
Method Detail

getSourceFileLineCoverageSet

public java.util.Set getSourceFileLineCoverageSet()

getJavaFileLine

public JavaFileLine getJavaFileLine()

addInstrumentation

public void addInstrumentation(Instrumentation instrumentation)
We add instrumentation to this instance, so we can work out which lines are hit and which are not.


setMasterLine

public void setMasterLine(Line masterLine)
This method overrides AbstractPage.setMasterLine(com.jcoverage.reporting.Line) so that we have convenient access to our master line, and don't have to constantly cast it.

Specified by:
setMasterLine in interface Page
Overrides:
setMasterLine in class AbstractPage

getValidSourceLines

public java.util.Set getValidSourceLines()

getSourceLinesCount

public int getSourceLinesCount()

getLineCoverageRate

public double getLineCoverageRate()

getBranchCoverageRate

public double getBranchCoverageRate()