org.hackystat.projectbrowser.page.dailyprojectdata.complexity
Class ComplexityData

java.lang.Object
  extended by org.hackystat.projectbrowser.page.dailyprojectdata.complexity.ComplexityData
All Implemented Interfaces:
java.io.Serializable

public class ComplexityData
extends java.lang.Object
implements java.io.Serializable

Data structure for representing complexity information about a single project. This representation includes the Project, plus the number of methods in the project with complexity in each of five buckets: 0-10, 11-20, 21-30, 31-40, and 41+

Author:
Philip Johnson, Shaoxuan Zhang
See Also:
Serialized Form

Constructor Summary
ComplexityData(org.hackystat.sensorbase.resource.projects.jaxb.Project name)
          Creates a new complexityData instance.
 
Method Summary
 void addEntry(org.hackystat.dailyprojectdata.resource.complexity.jaxb.FileData data)
          Adds the complexity data in this FileData instance to the appropriate buckets.
 void addEntry(int complexityCount, org.hackystat.dailyprojectdata.resource.complexity.jaxb.FileData data)
          Updates this ComplexityData instance with information about the number of complexitys for a specific class.
 java.lang.String getBucketCountString(int bucket)
          Returns the current value of the specified bucket as a string.
 int getBucketPercentage(int bucket)
          Returns the bucket value as a percentage of the total number of entries across all buckets.
 java.lang.String getBucketPercentageString(int bucket)
          Returns the bucket percentage as a string.
 int getBucketValue(int bucket)
          Returns the current value of the specified bucket.
 DailyProjectDetailsPanel getPanel(java.lang.String id, int bucket, boolean isCount)
          Returns a details panel containing information about this bucket.
 org.hackystat.sensorbase.resource.projects.jaxb.Project getProject()
          Return the project associated with this data.
 int getTotal()
          Returns the total number of entries across all buckets.
 java.lang.String getTotalString()
          Returns the total number of entries across all buckets as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexityData

public ComplexityData(org.hackystat.sensorbase.resource.projects.jaxb.Project name)
Creates a new complexityData instance.

Parameters:
name - The name of the Project associated with this instance.
Method Detail

addEntry

public void addEntry(org.hackystat.dailyprojectdata.resource.complexity.jaxb.FileData data)
Adds the complexity data in this FileData instance to the appropriate buckets.

Parameters:
data - The FileData.

addEntry

public void addEntry(int complexityCount,
                     org.hackystat.dailyprojectdata.resource.complexity.jaxb.FileData data)
Updates this ComplexityData instance with information about the number of complexitys for a specific class.

Parameters:
complexityCount - The number of complexitys.
data - The FileData containing this complexity count.

getBucketValue

public int getBucketValue(int bucket)
Returns the current value of the specified bucket.

Parameters:
bucket - The bucket number, where 0 is the first one and 4 is the last one.
Returns:
The value inside the given bucket.

getTotal

public int getTotal()
Returns the total number of entries across all buckets.

Returns:
The total number of entries.

getTotalString

public java.lang.String getTotalString()
Returns the total number of entries across all buckets as a string.

Returns:
The total number of entries.

getBucketPercentage

public int getBucketPercentage(int bucket)
Returns the bucket value as a percentage of the total number of entries across all buckets.

Parameters:
bucket - The bucket whose percentage is to be returned.
Returns:
The bucket as a percentage.

getBucketCountString

public java.lang.String getBucketCountString(int bucket)
Returns the current value of the specified bucket as a string.

Parameters:
bucket - The bucket number, where 0 is the first one and 4 is the last one.
Returns:
The value inside the given bucket.

getBucketPercentageString

public java.lang.String getBucketPercentageString(int bucket)
Returns the bucket percentage as a string.

Parameters:
bucket - The bucket.
Returns:
Its percentage as a string.

getProject

public org.hackystat.sensorbase.resource.projects.jaxb.Project getProject()
Return the project associated with this data.

Returns:
The project.

getPanel

public DailyProjectDetailsPanel getPanel(java.lang.String id,
                                         int bucket,
                                         boolean isCount)
Returns a details panel containing information about this bucket.

Parameters:
id - The wicket id for this panel.
bucket - The bucket of interest.
isCount - True if the count should be returned, false if percentage.
Returns:
The DailyProjectDetailsPanel instance.