net.sourceforge.cobertura.coveragedata
Class CoverageDataContainer
java.lang.Object
net.sourceforge.cobertura.coveragedata.CoverageDataContainer
- CoverageData, HasBeenInstrumented, Serializable
extends java.lang.Object
implements CoverageData, HasBeenInstrumented, Serializable
Coverage data information is typically serialized to a file.
This class implements HasBeenInstrumented so that when cobertura
instruments itself, it will omit this class. It does this to
avoid an infinite recursion problem because instrumented classes
make use of this class.
(package private) Map | children - Each key is the name of a child, usually stored as a String or
an Integer object.
|
children
(package private) Map children
Each key is the name of a child, usually stored as a String or
an Integer object. Each value is information about the child,
stored as an object that implements the CoverageData interface.
equals
public boolean equals(Object obj)
Determine if this CoverageDataContainer is equal to
another one. Subclasses should override this and
make sure they implement the hashCode method.
obj
- An object to test for equality.
- True if the objects are equal.
getBranchCoverageRate
public double getBranchCoverageRate()
- The average branch coverage rate for all children
in this container.
getChild
public CoverageData getChild(String name)
Get a child from this container with the specified
key.
name
- The key used to lookup the child in the
map.
- The child object, if found, or null if not found.
getLineCoverageRate
public double getLineCoverageRate()
- The average line coverage rate for all children
in this container. This number will be a decimal
between 0 and 1, inclusive.
hashCode
public int hashCode()
It is highly recommended that classes extending this
class override this hashCode method and generate a more
effective hash code.
merge
public void merge(CoverageData coverageData)
Merge two CoverageDataContainer
s.
coverageData
- The container to merge into this one.