|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sofya.ed.structural.CoverageTrace
public abstract class CoverageTrace
A coverage traces records the coverage of structural program entities (basic
blocks or branches) observed through execution of an instrumented program by
a ProgramEventDispatcher
.
Instrumentor
,
TraceHandler
,
ProgramEventDispatcher
,
TraceViewer
Field Summary | |
---|---|
protected int |
highestId
Highest structural entity number found in the method. |
protected java.util.BitSet |
traceVector
Bit vector which records program entities hit during execution. |
Constructor Summary | |
---|---|
protected |
CoverageTrace(int highestId)
Default constructor, creates a trace with the specified number of structural entities. |
Method Summary | |
---|---|
void |
clear()
Clears the covered status for every entity in the method. |
abstract CoverageTrace |
copy()
|
boolean |
equals(java.lang.Object obj)
Tests whether this trace object is equal to another trace. |
int |
getHighestId()
Gets the highest entity ID present in the method. |
boolean |
query(int id)
Queries whether an entity was covered during execution. |
void |
set(int id)
Marks that an entity was covered during execution. |
java.lang.String |
toString()
Returns a string representation of this trace. |
CoverageTrace |
union(CoverageTrace tr)
Creates a trace that is the union of this trace and another trace. |
void |
unset(int id)
Marks that an entity was not covered during execution. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.BitSet traceVector
protected int highestId
Constructor Detail |
---|
protected CoverageTrace(int highestId)
highestId
- Highest possible entity number in the method;
cannot be changed after instantiation.Method Detail |
---|
public int getHighestId()
public void set(int id)
id
- ID of the entity that was covered.public boolean query(int id)
id
- ID of the method entity to be queried.
true
if the entity was covered during execution,
false
otherwise.public void unset(int id)
id
- ID of the entity for which covered status is being
cleared.public void clear()
public abstract CoverageTrace copy()
public boolean equals(java.lang.Object obj)
Two trace objects are considered equal if their entity counts and trace bit vectors are equivalent.
equals
in class java.lang.Object
obj
- Trace to which this trace should be compared for equality.
true
if the specified trace is equal to
this trace, false
otherwise.public CoverageTrace union(CoverageTrace tr)
The specified trace must have the same number of method entities as this trace. The method will then take the logical union of the bit vectors in the two traces. The resulting trace will be an entirely new object, neither the current trace or the specified trace will be modified by this method.
tr
- Trace for which the union should be taken with
this trace.
public java.lang.String toString()
This method simply calls the toString()
method of the
underlying BitSet and returns the result. Typically this is a list of
the bits in the BitSet using vector notation
(e.g. [ 0 1 1 0 ... 1 ]
).
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |