net.sourceforge.cobertura.coveragedata
Class JumpData

java.lang.Object
  extended by net.sourceforge.cobertura.coveragedata.JumpData
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, BranchCoverageData, HasBeenInstrumented

public class JumpData
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

Field Summary
private  int conditionNumber
           
private  long falseHits
           
protected  java.util.concurrent.locks.Lock lock
           
private static long serialVersionUID
           
private  long trueHits
           
 
Constructor Summary
JumpData(int conditionNumber)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
           
private  void getBothLocks(JumpData other)
           
 double getBranchCoverageRate()
           
 int getConditionNumber()
           
 long getFalseHits()
           
 int getNumberOfCoveredBranches()
           
 int getNumberOfValidBranches()
           
 long getTrueHits()
           
 int hashCode()
           
private  void initLock()
           
 void merge(BranchCoverageData coverageData)
          Warning: This is generally implemented as a "shallow" merge.
private  void readObject(java.io.ObjectInputStream in)
           
(package private)  void touchBranch(boolean branch, int new_hits)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

lock

protected transient java.util.concurrent.locks.Lock lock

conditionNumber

private int conditionNumber

trueHits

private long trueHits

falseHits

private long falseHits
Constructor Detail

JumpData

JumpData(int conditionNumber)
Method Detail

initLock

private void initLock()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

touchBranch

void touchBranch(boolean branch,
                 int new_hits)

getConditionNumber

public int getConditionNumber()

getTrueHits

public long getTrueHits()

getFalseHits

public long getFalseHits()

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(JumpData other)

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException