org.hackystat.dailyprojectdata.resource.codeissue
Class IssueTypeCounter

java.lang.Object
  extended by org.hackystat.dailyprojectdata.resource.codeissue.IssueTypeCounter

public class IssueTypeCounter
extends java.lang.Object

IssueTypeCounter takes a set of CodeIssue SensorData all associated with a single tool, and constructs a data structure that maps issue types to their aggregate counts across all tools. For example, consider two CodeIssue sensor data instances, illustrated below:

 [SensorData tool="Foo" sdt="CodeIssue" properties(["JavaDoc", "2"], ["Indentation", "3"])]
 [SensorData tool="Foo" sdt="CodeIssue" properties(["JavaDoc", "4"], ["NPE", "3"])]
 
We process these SensorData instances into the following IssueTypeCounter map:
 ["JavaDoc", 6]
 ["Indentation", 3]
 ["NPE", 3]
 

Author:
Philip Johnson

Constructor Summary
IssueTypeCounter(java.util.Set<org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData> dataSet, java.util.logging.Logger logger)
          Constructs the IssueTypeCounter from the passed set of SensorData instances.
 
Method Summary
 int getCount(java.lang.String type)
          Return the number of CodeIssues of the given type found in this snapshot.
 java.util.Set<java.lang.String> getTypes()
          Get the set of all types found from processing the sensor data snapshot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssueTypeCounter

public IssueTypeCounter(java.util.Set<org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData> dataSet,
                        java.util.logging.Logger logger)
Constructs the IssueTypeCounter from the passed set of SensorData instances.

Parameters:
dataSet - The snapshot of sensor data instances for a given tool.
logger - The logger to get errors.
Method Detail

getTypes

public java.util.Set<java.lang.String> getTypes()
Get the set of all types found from processing the sensor data snapshot.

Returns:
The set of CodeIssue types.

getCount

public int getCount(java.lang.String type)
Return the number of CodeIssues of the given type found in this snapshot.

Parameters:
type - The CodeIssue type.
Returns:
The count, or zero if this type was not found.