net.sourceforge.cobertura.coveragedata
Class SwitchData
java.lang.Object
net.sourceforge.cobertura.coveragedata.SwitchData
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, BranchCoverageData, HasBeenInstrumented
public class SwitchData
- extends java.lang.Object
- implements BranchCoverageData, java.lang.Comparable, java.io.Serializable, HasBeenInstrumented
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
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
switchNumber
private int switchNumber
defaultHits
private long defaultHits
hits
private long[] hits
keys
private int[] keys
SwitchData
public SwitchData(int switchNumber,
int[] keys)
SwitchData
public SwitchData(int switchNumber,
int min,
int max)
SwitchData
public SwitchData(int switchNumber)
initLock
private void initLock()
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interface java.lang.Comparable
touchBranch
void touchBranch(int branch)
getSwitchNumber
public int getSwitchNumber()
getHits
public long getHits(int branch)
getDefaultHits
public long getDefaultHits()
getBranchCoverageRate
public double getBranchCoverageRate()
- Specified by:
getBranchCoverageRate
in interface BranchCoverageData
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
getNumberOfCoveredBranches
public int getNumberOfCoveredBranches()
- Specified by:
getNumberOfCoveredBranches
in interface BranchCoverageData
getNumberOfValidBranches
public int getNumberOfValidBranches()
- Specified by:
getNumberOfValidBranches
in interface BranchCoverageData
merge
public void merge(BranchCoverageData coverageData)
- Description copied from interface:
BranchCoverageData
- 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 BranchCoverageData
getBothLocks
private void getBothLocks(SwitchData other)
readObject
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException