org.hackystat.dailyprojectdata.resource.codeissue
Class MultiToolSnapshot

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

public class MultiToolSnapshot
extends java.lang.Object

Provides a mechanism for generating a "snapshot" for each of several tools. The "snapshot" is the set of sensor data instances for the given tool with the latest runtime value. To use this tool, create an instance, then add() each sensor data instance of interest to it. When finished, you can obtain a snapshot for any given tool, which is the set of sensor data instances associated with that tool with the latest runtime value.

Author:
Philip Johnson

Constructor Summary
MultiToolSnapshot()
          Create a MultiToolSnapshot.
 
Method Summary
 void add(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
          Processes the SensorData instance, potentially adding it if its runtime is equal to or greater than the runtime associated with the stored instances of that tool.
 java.util.Set<org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData> getSensorData(java.lang.String tool)
          Returns the latest snapshot associated with the specified tool.
 java.util.Set<java.lang.String> getTools()
          Returns the set of all Tools in this MultiToolSnapshot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiToolSnapshot

public MultiToolSnapshot()
Create a MultiToolSnapshot.

Method Detail

add

public void add(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
Processes the SensorData instance, potentially adding it if its runtime is equal to or greater than the runtime associated with the stored instances of that tool.

Parameters:
data - The sensor data instance.

getTools

public java.util.Set<java.lang.String> getTools()
Returns the set of all Tools in this MultiToolSnapshot.

Returns:
The set of all tools.

getSensorData

public java.util.Set<org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData> getSensorData(java.lang.String tool)
Returns the latest snapshot associated with the specified tool.

Parameters:
tool - The tool name.
Returns:
The snapshot, which could be empty.