public abstract class CoverageDataContainer extends java.lang.Object implements CoverageData, HasBeenInstrumented, java.io.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.
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.Map<java.lang.Object,CoverageData> |
children
Each key is the name of a child, usually stored as a String or
an Integer object.
|
protected java.util.concurrent.locks.Lock |
lock |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
CoverageDataContainer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Determine if this CoverageDataContainer is equal to
another one.
|
protected void |
getBothLocks(CoverageDataContainer other) |
double |
getBranchCoverageRate() |
CoverageData |
getChild(java.lang.String name)
Get a child from this container with the specified
key.
|
double |
getLineCoverageRate() |
int |
getNumberOfChildren() |
int |
getNumberOfCoveredBranches() |
int |
getNumberOfCoveredLines() |
int |
getNumberOfValidBranches() |
int |
getNumberOfValidLines() |
int |
hashCode()
It is highly recommended that classes extending this
class override this hashCode method and generate a more
effective hash code.
|
private void |
initLock() |
void |
merge(CoverageData coverageData)
Merge two
CoverageDataContainers. |
private void |
readObject(java.io.ObjectInputStream in) |
private static final long serialVersionUID
protected transient java.util.concurrent.locks.Lock lock
java.util.Map<java.lang.Object,CoverageData> children
public CoverageDataContainer()
private void initLock()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - An object to test for equality.public double getBranchCoverageRate()
getBranchCoverageRate in interface CoverageDatapublic CoverageData getChild(java.lang.String name)
name - The key used to lookup the child in the
map.public double getLineCoverageRate()
getLineCoverageRate in interface CoverageDatapublic int getNumberOfChildren()
public int getNumberOfCoveredBranches()
getNumberOfCoveredBranches in interface CoverageDatapublic int getNumberOfCoveredLines()
getNumberOfCoveredLines in interface CoverageDatapublic int getNumberOfValidBranches()
getNumberOfValidBranches in interface CoverageDatapublic int getNumberOfValidLines()
getNumberOfValidLines in interface CoverageDatapublic int hashCode()
hashCode in class java.lang.Objectpublic void merge(CoverageData coverageData)
CoverageDataContainers.merge in interface CoverageDatacoverageData - The container to merge into this one.protected void getBothLocks(CoverageDataContainer other)
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundException