public final class ExecutionDataStore extends Object implements IExecutionDataVisitor
IExecutionDataVisitor
interface. If execution data is provided
multiple times for the same class the data is merged, i.e. a probe is marked
as executed if it is reported as executed at least once. This allows to merge
coverage date from multiple runs. A instance of this class is not thread
safe.Constructor and Description |
---|
ExecutionDataStore() |
Modifier and Type | Method and Description |
---|---|
void |
accept(IExecutionDataVisitor visitor)
Writes the content of the store to the given visitor interface.
|
ExecutionData |
get(long id)
Returns the
ExecutionData entry with the given id if it exists in
this store. |
ExecutionData |
get(Long id,
String name,
int dataLength)
Returns the coverage data for the class with the given identifier.
|
Collection<ExecutionData> |
getContents()
Returns a collection that represents current contents of the store.
|
void |
put(ExecutionData data)
Adds the given
ExecutionData object into the store. |
void |
reset()
Resets all execution data probes, i.e.
|
void |
visitClassExecution(ExecutionData data)
Provides execution data for a class.
|
public void put(ExecutionData data) throws IllegalStateException
ExecutionData
object into the store. If there is
already execution data with this same class id, this structure is merged
with the given one.data
- execution data to add or mergeIllegalStateException
- if the given ExecutionData
object is not compatible
to a corresponding one, that is already containedExecutionData.assertCompatibility(long, String, int)
public ExecutionData get(long id)
ExecutionData
entry with the given id if it exists in
this store.id
- class idnull
public ExecutionData get(Long id, String name, int dataLength)
id
- class identifiername
- VM name of the classdataLength
- probe data lengthpublic void reset()
public Collection<ExecutionData> getContents()
public void accept(IExecutionDataVisitor visitor)
visitor
- interface to write content topublic void visitClassExecution(ExecutionData data)
IExecutionDataVisitor
visitClassExecution
in interface IExecutionDataVisitor
data
- execution data for a classCopyright © 2013. All Rights Reserved.