sofya.ed.structural
Class BlockCoverageTrace

java.lang.Object
  extended by sofya.ed.structural.CoverageTrace
      extended by sofya.ed.structural.BlockCoverageTrace
All Implemented Interfaces:
BlockCoverageListener

public class BlockCoverageTrace
extends CoverageTrace
implements BlockCoverageListener

A basic block coverage trace records the coverage of basic blocks in a method.

Version:
03/13/2006
Author:
Alex Kinneer

Field Summary
 
Fields inherited from class sofya.ed.structural.CoverageTrace
highestId, traceVector
 
Constructor Summary
BlockCoverageTrace(int highestId)
          Creates a new basic block coverage trace.
 
Method Summary
 void blockCovered(int id, int blockType)
          Records a basic block 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

BlockCoverageTrace

public BlockCoverageTrace(int highestId)
Creates a new basic block coverage trace.

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

blockCovered

public void blockCovered(int id,
                         int blockType)
Records a basic block as covered.

Specified by:
blockCovered in interface BlockCoverageListener
Parameters:
id - Identifier associated with the covered basic block.
blockType - Numeric constant encoding the type of basic block covered (see SConstants.BlockType).

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 basic blocks and the same basic blocks marked as covered.