org.hackystat.dailyprojectdata.resource.coverage
Class CoverageData

java.lang.Object
  extended by org.hackystat.dailyprojectdata.resource.coverage.CoverageData

public class CoverageData
extends java.lang.Object

The class wrapping SensorData instance, which provides easy access to the coverage specific properties.

Author:
aito

Field Summary
static java.lang.String GRANULARITY_BLOCK
          The string used to mark the block level granularity of coverage data.
static java.lang.String GRANULARITY_CLASS
          The string used to mark the class level granularity of coverage data.
static java.lang.String GRANULARITY_LINE
          The string used to mark the line level granularity of coverage data.
static java.lang.String GRANULARITY_METHOD
          The string used to mark the method level granularity of coverage data.
 
Constructor Summary
CoverageData(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
          Constructs this object with the specified SensorData instance.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns true if the specified object equals this object.
 org.hackystat.sensorbase.resource.sensordata.jaxb.Property getCoverageProperty(java.lang.String propertyName)
          Returns the Property instance with the specified property name.
 int getCovered(java.lang.String granularity)
          Returns the covered coverage value.
 java.lang.String getOwner()
          Returns the owner of the wrapped data instance.
 java.lang.String getResource()
          Returns the resource of the wrapped data instance.
 javax.xml.datatype.XMLGregorianCalendar getRuntime()
          Returns the runtime of this data instance.
 int getUncovered(java.lang.String granularity)
          Returns the uncovered coverage value.
 int hashCode()
          Returns the hashcode of this object.
 java.lang.String toString()
          Returns the string representation of this data object, which is useful for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GRANULARITY_CLASS

public static final java.lang.String GRANULARITY_CLASS
The string used to mark the class level granularity of coverage data.

See Also:
Constant Field Values

GRANULARITY_BLOCK

public static final java.lang.String GRANULARITY_BLOCK
The string used to mark the block level granularity of coverage data.

See Also:
Constant Field Values

GRANULARITY_METHOD

public static final java.lang.String GRANULARITY_METHOD
The string used to mark the method level granularity of coverage data.

See Also:
Constant Field Values

GRANULARITY_LINE

public static final java.lang.String GRANULARITY_LINE
The string used to mark the line level granularity of coverage data.

See Also:
Constant Field Values
Constructor Detail

CoverageData

public CoverageData(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
Constructs this object with the specified SensorData instance.

Parameters:
data - the specified data instance.
Method Detail

getResource

public java.lang.String getResource()
Returns the resource of the wrapped data instance.

Returns:
the data resource.

getOwner

public java.lang.String getOwner()
Returns the owner of the wrapped data instance.

Returns:
the data owner.

getUncovered

public int getUncovered(java.lang.String granularity)
Returns the uncovered coverage value. This method assumes that the uncovered data is stored as a property in the following format: 'granularity_Uncovered' where granularity is a lower case string.

Parameters:
granularity - the level of uncovered data to return.
Returns:
the uncovered value.

getCovered

public int getCovered(java.lang.String granularity)
Returns the covered coverage value. This method assumes that the covered data is stored as a property in the following format: 'granularity_Covered' where granularity is a lower case string.

Parameters:
granularity - the level of covered data to return.
Returns:
the covered value.

equals

public boolean equals(java.lang.Object object)
Returns true if the specified object equals this object.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to test.
Returns:
true if equal, false if not.

hashCode

public int hashCode()
Returns the hashcode of this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode.

getCoverageProperty

public org.hackystat.sensorbase.resource.sensordata.jaxb.Property getCoverageProperty(java.lang.String propertyName)
Returns the Property instance with the specified property name. If no property exists, false is returned.

Parameters:
propertyName - the property name to search for.
Returns:
the property with the specified name or null.

getRuntime

public javax.xml.datatype.XMLGregorianCalendar getRuntime()
Returns the runtime of this data instance.

Returns:
the runtime of this data.

toString

public java.lang.String toString()
Returns the string representation of this data object, which is useful for debugging purposes.

Overrides:
toString in class java.lang.Object
Returns:
the string representation.