net.sourceforge.cobertura.coveragedata
Class LineData
java.lang.Object
net.sourceforge.cobertura.coveragedata.LineData
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, CoverageData, HasBeenInstrumented
public class LineData
- extends java.lang.Object
- implements java.lang.Comparable, CoverageData, HasBeenInstrumented, java.io.Serializable
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.
- See Also:
- Serialized Form
Constructor Summary |
LineData(int lineNumber)
|
LineData(int lineNumber,
java.lang.String methodName,
java.lang.String methodDescriptor)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
lock
private transient java.util.concurrent.locks.Lock lock
hits
private long hits
jumps
private java.util.List jumps
switches
private java.util.List switches
lineNumber
private final int lineNumber
methodDescriptor
private java.lang.String methodDescriptor
methodName
private java.lang.String methodName
LineData
LineData(int lineNumber)
LineData
LineData(int lineNumber,
java.lang.String methodName,
java.lang.String methodDescriptor)
initLock
private void initLock()
compareTo
public int compareTo(java.lang.Object o)
- This is required because we implement Comparable.
- Specified by:
compareTo
in interface java.lang.Comparable
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
getBranchCoverageRate
public double getBranchCoverageRate()
- Specified by:
getBranchCoverageRate
in interface CoverageData
getConditionCoverage
public java.lang.String getConditionCoverage()
getHits
public long getHits()
isCovered
public boolean isCovered()
getLineCoverageRate
public double getLineCoverageRate()
- Specified by:
getLineCoverageRate
in interface CoverageData
getLineNumber
public int getLineNumber()
getMethodDescriptor
public java.lang.String getMethodDescriptor()
getMethodName
public java.lang.String getMethodName()
getNumberOfCoveredLines
public int getNumberOfCoveredLines()
- Specified by:
getNumberOfCoveredLines
in interface CoverageData
- See Also:
CoverageData.getNumberOfCoveredBranches()
getNumberOfValidBranches
public int getNumberOfValidBranches()
- Specified by:
getNumberOfValidBranches
in interface CoverageData
getNumberOfCoveredBranches
public int getNumberOfCoveredBranches()
- Specified by:
getNumberOfCoveredBranches
in interface CoverageData
getNumberOfValidLines
public int getNumberOfValidLines()
- Specified by:
getNumberOfValidLines
in interface CoverageData
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
hasBranch
public boolean hasBranch()
merge
public void merge(CoverageData coverageData)
- Description copied from interface:
CoverageData
- Warning: This is generally implemented as a
"shallow" merge. For our current use, this
should be fine, but in the future it may make
sense to modify the merge methods of the
various classes to do a deep copy of the
appropriate objects.
- Specified by:
merge
in interface CoverageData
addJump
void addJump(int jumpNumber)
addSwitch
void addSwitch(int switchNumber,
int[] keys)
addSwitch
void addSwitch(int switchNumber,
int min,
int max)
setMethodNameAndDescriptor
void setMethodNameAndDescriptor(java.lang.String name,
java.lang.String descriptor)
touch
void touch(int new_hits)
touchJump
void touchJump(int jumpNumber,
boolean branch,
int hits)
touchSwitch
void touchSwitch(int switchNumber,
int branch,
int hits)
getConditionSize
public int getConditionSize()
getConditionData
public java.lang.Object getConditionData(int index)
getConditionCoverage
public java.lang.String getConditionCoverage(int index)
getJumpData
JumpData getJumpData(int jumpNumber)
getSwitchData
SwitchData getSwitchData(int switchNumber,
SwitchData data)
getBothLocks
private void getBothLocks(LineData other)
readObject
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException