net.sourceforge.cobertura.coveragedata

Class ProjectData

public class ProjectData extends CoverageDataContainer implements HasBeenInstrumented

Field Summary
Mapclasses
This collection is used for quicker access to the list of classes.
static ProjectDataglobalProjectData
static SaveTimersaveTimer
static longserialVersionUID
Method Summary
voidaddClassData(ClassData classData)
ClassDatagetClassData(String name)
CollectiongetClasses()
static ProjectDatagetGlobalProjectData()
Get a reference to a ProjectData object in order to increase the coverage count for a specific line.
intgetNumberOfClasses()
intgetNumberOfSourceFiles()
ClassDatagetOrCreateClassData(String name)
This is called by instrumented bytecode.
SortedSetgetPackages()
CollectiongetSourceFiles()
SortedSetgetSubPackages(String packageName)
Get all subpackages of the given package.
static voidinitialize()
static ProjectDataloadCoverageDataFromDatafile(File dataFile)
voidmerge(CoverageData coverageData)
static voidsaveGlobalProjectData()

Field Detail

classes

private Map classes
This collection is used for quicker access to the list of classes.

globalProjectData

private static ProjectData globalProjectData

saveTimer

private static SaveTimer saveTimer

serialVersionUID

private static final long serialVersionUID

Method Detail

addClassData

public void addClassData(ClassData classData)

getClassData

public ClassData getClassData(String name)

getClasses

public Collection getClasses()

getGlobalProjectData

public static ProjectData getGlobalProjectData()
Get a reference to a ProjectData object in order to increase the coverage count for a specific line. This method is only called by code that has been instrumented. It is not called by any of the Cobertura code or ant tasks.

getNumberOfClasses

public int getNumberOfClasses()

getNumberOfSourceFiles

public int getNumberOfSourceFiles()

getOrCreateClassData

public ClassData getOrCreateClassData(String name)
This is called by instrumented bytecode.

getPackages

public SortedSet getPackages()

getSourceFiles

public Collection getSourceFiles()

getSubPackages

public SortedSet getSubPackages(String packageName)
Get all subpackages of the given package. Includes also specified package if it exists.

Parameters: packageName The package name to find subpackages for. For example, "com.example"

Returns: A collection containing PackageData objects. Each one has a name beginning with the given packageName. For example: "com.example.io", "com.example.io.internal"

initialize

private static void initialize()

loadCoverageDataFromDatafile

private static ProjectData loadCoverageDataFromDatafile(File dataFile)

merge

public void merge(CoverageData coverageData)

saveGlobalProjectData

public static void saveGlobalProjectData()