コード例 #1
0
 /**
  * Subtracts the probes in the given {@link ExecutionData} object from the store. I.e. for all set
  * probes in the given data object the corresponding probes in this store will be unset. If there
  * is no execution data with id of the given data object this operation will have no effect.
  *
  * @param data execution data to subtract
  * @throws IllegalStateException if the given {@link ExecutionData} object is not compatible to a
  *     corresponding one, that is already contained
  * @see ExecutionData#assertCompatibility(long, String, int)
  */
 public void subtract(final ExecutionData data) throws IllegalStateException {
   final Long id = Long.valueOf(data.getId());
   final ExecutionData entry = entries.get(id);
   if (entry != null) {
     entry.merge(data, false);
   }
 }
コード例 #2
0
 /**
  * Adds the given {@link ExecutionData} object into the store. If there is already execution data
  * with this same class id, this structure is merged with the given one.
  *
  * @param data execution data to add or merge
  * @throws IllegalStateException if the given {@link ExecutionData} object is not compatible to a
  *     corresponding one, that is already contained
  * @see ExecutionData#assertCompatibility(long, String, int)
  */
 public void put(final ExecutionData data) throws IllegalStateException {
   final Long id = Long.valueOf(data.getId());
   final ExecutionData entry = entries.get(id);
   if (entry == null) {
     entries.put(id, data);
     names.add(data.getName());
   } else {
     entry.merge(data);
   }
 }
コード例 #3
0
 /**
  * Returns the coverage data for the class with the given identifier. If there is no data
  * available under the given id a new entry is created.
  *
  * @param id class identifier
  * @param name VM name of the class
  * @param probecount probe data length
  * @return execution data
  */
 public ExecutionData get(final Long id, final String name, final int probecount) {
   ExecutionData entry = entries.get(id);
   if (entry == null) {
     entry = new ExecutionData(id.longValue(), name, probecount);
     entries.put(id, entry);
     names.add(name);
   } else {
     entry.assertCompatibility(id.longValue(), name, probecount);
   }
   return entry;
 }
コード例 #4
0
 /**
  * Resets all execution data probes, i.e. marks them as not executed. The execution data objects
  * itself are not removed.
  */
 public void reset() {
   for (final ExecutionData executionData : this.entries.values()) {
     executionData.reset();
   }
 }