org.jacoco.core.data
Class ExecutionData

java.lang.Object
  extended by org.jacoco.core.data.ExecutionData

public final class ExecutionData
extends Object

Execution data for a single Java class. While instances are immutable care has to be taken about the probe data array of type boolean[] which can be modified.


Constructor Summary
ExecutionData(long id, String name, boolean[] data)
          Creates a new ExecutionData object with the given probe data.
ExecutionData(long id, String name, int dataLength)
          Creates a new ExecutionData object with the given probe data length.
 
Method Summary
 void assertCompatibility(long id, String name, int dataLength)
          Asserts that this execution data object is compatible with the given parameters.
 boolean[] getData()
          Returns the execution data probes.
 long getId()
          Return the unique identifier for this class.
 String getName()
          The VM name of the class.
 void merge(ExecutionData other)
          Merges the given execution data into the probe data of this object.
 void reset()
          Sets all probe data entries to false.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecutionData

public ExecutionData(long id,
                     String name,
                     boolean[] data)
Creates a new ExecutionData object with the given probe data.

Parameters:
id - class identifier
name - VM name
data - probe data

ExecutionData

public ExecutionData(long id,
                     String name,
                     int dataLength)
Creates a new ExecutionData object with the given probe data length. All probes are set to false.

Parameters:
id - class identifier
name - VM name
dataLength - probe data length
Method Detail

getId

public long getId()
Return the unique identifier for this class. The identifier is the CRC64 checksum of the raw class file definition.

Returns:
class identifier

getName

public String getName()
The VM name of the class.

Returns:
VM name

getData

public boolean[] getData()
Returns the execution data probes. A value of true indicates that the corresponding probe was executed.

Returns:
execution data

reset

public void reset()
Sets all probe data entries to false.


merge

public void merge(ExecutionData other)
Merges the given execution data into the probe data of this object. I.e. a probe entry in this object is marked as executed (true) if this probe or the corresponding other probe was executed. The probe array of the other object is not modified.

Parameters:
other -

assertCompatibility

public void assertCompatibility(long id,
                                String name,
                                int dataLength)
                         throws IllegalStateException
Asserts that this execution data object is compatible with the given parameters. The purpose of this check is to detect a very unlikely class id collision.

Parameters:
id - other class id, must be the same
name - other name, must be equal to this name
dataLength - probe data length, must be the same as for this data
Throws:
IllegalStateException - if the given parameters do not match this instance

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 Mountainminds GmbH & Co. KG. All Rights Reserved.