sofya.ed.structural
Class BranchCoverageTrace

java.lang.Object
  extended by sofya.ed.structural.CoverageTrace
      extended by sofya.ed.structural.BranchCoverageTrace
All Implemented Interfaces:
BranchCoverageListener

public class BranchCoverageTrace
extends CoverageTrace
implements BranchCoverageListener

A branch coverage trace records the coverage of branches in a method.

Version:
03/13/2006
Author:
Alex Kinneer

Field Summary
 
Fields inherited from class sofya.ed.structural.CoverageTrace
highestId, traceVector
 
Constructor Summary
BranchCoverageTrace(int highestId)
          Creates a new branch coverage trace.
 
Method Summary
 void branchCovered(int id, int branchType)
          Records a branch as covered.
 CoverageTrace copy()
          Creates a deep clone of this trace object.
 
Methods inherited from class sofya.ed.structural.CoverageTrace
clear, equals, getHighestId, query, set, toString, union, unset
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BranchCoverageTrace

public BranchCoverageTrace(int highestId)
Creates a new branch coverage trace.

Parameters:
highestId - The highest identifier associated with any branch in the method (effectively the number of branches in the method.
Method Detail

branchCovered

public void branchCovered(int id,
                          int branchType)
Records a branch as covered.

Specified by:
branchCovered in interface BranchCoverageListener
Parameters:
id - Identifier associated with the covered branch.
branchType - Numeric constant encoding the type of branch covered (see SConstants.BranchType).

copy

public CoverageTrace copy()
Creates a deep clone of this trace object.

Specified by:
copy in class CoverageTrace
Returns:
A new trace object with the same number of branches and the same branches marked as covered.