org.hackystat.projectbrowser.page.projectportfolio.detailspanel.chart
Class StreamDeviationClassifier

java.lang.Object
  extended by org.hackystat.projectbrowser.page.projectportfolio.detailspanel.chart.StreamDeviationClassifier
All Implemented Interfaces:
java.io.Serializable, StreamClassifier

public class StreamDeviationClassifier
extends java.lang.Object
implements java.io.Serializable, StreamClassifier

Classify the trend according to its deviation. Higher deviation is worse. Expectation value is not considered when coloring trend. Value is colored according to its deviation to the expectation value.

Author:
Shaoxuan
See Also:
Serialized Form

Field Summary
static java.lang.String name
          Name of this classifier.
 
Constructor Summary
StreamDeviationClassifier(double moderateDeviation, double unacceptableDeviation, double expectationValue, boolean scaleWithGranularity)
           
 
Method Summary
 org.apache.wicket.markup.html.panel.Panel getConfigurationPanel(java.lang.String id)
          Return the panel for users to configure this classifier.
 java.lang.String getName()
          
 PortfolioCategory getStreamCategory(MiniBarChart chart)
          Parse the given MiniBarChart and produce a PortfolioCategory result.
 PortfolioCategory getValueCategory(double value)
          Return the category of the given value.
 void saveSetting(Measures.Measure measure)
          Save classifier's setting into the given Measures.Measure instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public static final java.lang.String name
Name of this classifier.

See Also:
Constant Field Values
Constructor Detail

StreamDeviationClassifier

public StreamDeviationClassifier(double moderateDeviation,
                                 double unacceptableDeviation,
                                 double expectationValue,
                                 boolean scaleWithGranularity)
Parameters:
moderateDeviation - The deviation within which the trend is considered healthy.
unacceptableDeviation - The deviation beyond which the trend is considered unhealthy.
expectationValue - The expectation value.
scaleWithGranularity - If the condition will scale with granularity.
Method Detail

getConfigurationPanel

public org.apache.wicket.markup.html.panel.Panel getConfigurationPanel(java.lang.String id)
Return the panel for users to configure this classifier.

Specified by:
getConfigurationPanel in interface StreamClassifier
Parameters:
id - The Wicket component id.
Returns:
a Panel

getName

public java.lang.String getName()

Specified by:
getName in interface StreamClassifier
Returns:
the name of this classifier.

getStreamCategory

public PortfolioCategory getStreamCategory(MiniBarChart chart)
Parse the given MiniBarChart and produce a PortfolioCategory result. Result is determined by the comparison of the standard deviation of the chart to the moderateDeviation and unacceptableDeviation. Less than moderateDeviation will be GOOD. Larger than moderateDeviation and less than unacceptableDeviation will be AVERAGE. Otherwise will be POOR.

Specified by:
getStreamCategory in interface StreamClassifier
Parameters:
chart - the input chart
Returns:
PortfolioCategory that indicates the health category of the chart: POOR, AVERAGE, GOOD. NA will be returned if chart is empty.

getValueCategory

public PortfolioCategory getValueCategory(double value)
Return the category of the given value. If value is lower than moderateDeviation, GOOD will be returned. If value is lower than unacceptableDeviation, AVERAGE will be returned. Otherwise, will return POOR.

Specified by:
getValueCategory in interface StreamClassifier
Parameters:
value - the given value.
Returns:
a PortfolioCategory result

saveSetting

public void saveSetting(Measures.Measure measure)
Save classifier's setting into the given Measures.Measure instance.

Specified by:
saveSetting in interface StreamClassifier
Parameters:
measure - the given Measures.Measure instance