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

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

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

The data model for Complexity DPD display. This data model accommodates multiple Projects. For each project, the data model indicates the number of methods whose level of complexity falls into each of five buckets, from 0-10, 11-20, 21-30, 31-40, 41+. At present, we only get cyclomatic complexity from the JavaNCSS tool. This will change after we update the DPD client to not require the tool argument.

Author:
Philip Johnson
See Also:
Serialized Form

Constructor Summary
ComplexityDataModel()
          The default ComplexityDataModel, which contains no complexity information.
 
Method Summary
 void clear()
          Sets this model to its empty state.
 ComplexityData getComplexityData(org.hackystat.sensorbase.resource.projects.jaxb.Project project)
          Return the ComplexityData instance associated with the specified project.
 java.util.List<ComplexityData> getComplexityDataList()
          Returns the list of ComplexityData instances, needed for markup.
 boolean isEmpty()
          Returns true if this data model contains no information.
 void update()
          Updates this data model to reflect the complexity information associated with the selected projects and granularity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexityDataModel

public ComplexityDataModel()
The default ComplexityDataModel, which contains no complexity information.

Method Detail

update

public void update()
Updates this data model to reflect the complexity information associated with the selected projects and granularity.


clear

public void clear()
Sets this model to its empty state.


isEmpty

public boolean isEmpty()
Returns true if this data model contains no information. Used to figure out if the associated panel should be visible.

Returns:
True if the data model is empty.

getComplexityData

public ComplexityData getComplexityData(org.hackystat.sensorbase.resource.projects.jaxb.Project project)
Return the ComplexityData instance associated with the specified project. Creates and returns a new ComplexityData instance if one is not yet present.

Parameters:
project - The project.
Returns:
The ComplexityData instance for this project.

getComplexityDataList

public java.util.List<ComplexityData> getComplexityDataList()
Returns the list of ComplexityData instances, needed for markup.

Returns:
The list of ComplexityData instances.