lt.monarch.chart.spc.math
Class PValuesCalculator

java.lang.Object
  extended by lt.monarch.chart.spc.math.ValuesCalculator
      extended by lt.monarch.chart.spc.math.ControlValuesCalculator
          extended by lt.monarch.chart.spc.math.PValuesCalculator

public class PValuesCalculator
extends ControlValuesCalculator

Calculates values for p-chart Values are calculated using formulas: http://www.singleton-labs.com/doc/mcharts/guide/#guide/chart-types/4.3.1.html


Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.chart.spc.math.ValuesCalculator
nullName
 
Constructor Summary
Constructor and Description
PValuesCalculator()
           
 
Method Summary
Modifier and Type Method and Description
protected  double getAvgP(ChartDataModel dataModel)
          Calculates he average p value.
 ChartDataModel getCenter(ChartDataModel dataModel)
          Calculates the center line data model (usually the average of all data)
 void getCenter(ChartDataModel dataModel, ChartDataModel dstModel)
          Fill given data model with center line data.
 ChartDataModel getChartLine(ChartDataModel dataModel)
          Calculates chart line data model (measurements, averages, standard deviation of sample of measurements, depending on the chart type).
 void getChartLine(ChartDataModel dataModel, ChartDataModel dstModel)
          Fill given data model (measurements, averages, standard deviation of sample of measurements, depending on the chart type).
 ChartDataModel getLCL(ChartDataModel dataModel)
          Calculates chart lower control limit data model.
 void getLCL(ChartDataModel dataModel, ChartDataModel dstModel)
          Calculates chart lower control limit data and fills given data model.
 ChartDataModel getUCL(ChartDataModel dataModel)
          Calculates chart upper control limit data model.
 void getUCL(ChartDataModel dataModel, ChartDataModel dstModel)
          Calculates chart upper control limit data and fills given data model.
protected  void validateDataModel(ChartDataModel dataModel)
          Validates data model.
 
Methods inherited from class lt.monarch.chart.spc.math.ControlValuesCalculator
averageRange, getLabels, getN, getRange, sigmaX
 
Methods inherited from class lt.monarch.chart.spc.math.ValuesCalculator
average, fill, fill, fillColumn, fillColumn, fillConstant, fillConstant, getAverage, getc4, getColumn, getd2, getd3, getD3, getD4, getDouble, getE, getF, getG, getH, isEmpty, isNconstant, validateDataModel, validateDataModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PValuesCalculator

public PValuesCalculator()
Method Detail

getCenter

public ChartDataModel getCenter(ChartDataModel dataModel)
                         throws DataFormatException
Description copied from class: ControlValuesCalculator
Calculates the center line data model (usually the average of all data)

Specified by:
getCenter in class ControlValuesCalculator
Parameters:
dataModel - input data.
Throws:
DataFormatException

getCenter

public void getCenter(ChartDataModel dataModel,
                      ChartDataModel dstModel)
               throws DataFormatException
Description copied from class: ControlValuesCalculator
Fill given data model with center line data.

Specified by:
getCenter in class ControlValuesCalculator
Parameters:
dataModel - input data model.
dstModel - destination data model
Throws:
DataFormatException - when the invalid data is found.

getChartLine

public ChartDataModel getChartLine(ChartDataModel dataModel)
                            throws DataFormatException
Description copied from class: ControlValuesCalculator
Calculates chart line data model (measurements, averages, standard deviation of sample of measurements, depending on the chart type).

Specified by:
getChartLine in class ControlValuesCalculator
Parameters:
dataModel - input data model.
Returns:
chart line data model.
Throws:
DataFormatException - when the input data are invalid.

getChartLine

public void getChartLine(ChartDataModel dataModel,
                         ChartDataModel dstModel)
                  throws DataFormatException
Description copied from class: ControlValuesCalculator
Fill given data model (measurements, averages, standard deviation of sample of measurements, depending on the chart type).

Specified by:
getChartLine in class ControlValuesCalculator
Parameters:
dataModel - input data model.
dstModel - destination data model
Throws:
DataFormatException - when the invalid data is found.

getLCL

public ChartDataModel getLCL(ChartDataModel dataModel)
                      throws DataFormatException
Description copied from class: ControlValuesCalculator
Calculates chart lower control limit data model.

Specified by:
getLCL in class ControlValuesCalculator
Parameters:
dataModel - input data model.
Returns:
chart lower control limit data model.
Throws:
DataFormatException - when the input data are invalid.

getLCL

public void getLCL(ChartDataModel dataModel,
                   ChartDataModel dstModel)
            throws DataFormatException
Description copied from class: ControlValuesCalculator
Calculates chart lower control limit data and fills given data model.

Specified by:
getLCL in class ControlValuesCalculator
Parameters:
dataModel - input data model.
dstModel - lower control limit destination data model.
Throws:
DataFormatException - when the input data are invalid.

getUCL

public ChartDataModel getUCL(ChartDataModel dataModel)
                      throws DataFormatException
Description copied from class: ControlValuesCalculator
Calculates chart upper control limit data model.

Specified by:
getUCL in class ControlValuesCalculator
Parameters:
dataModel - input data model.
Returns:
chart upper control limit data model.
Throws:
DataFormatException - when the input data are invalid.

getUCL

public void getUCL(ChartDataModel dataModel,
                   ChartDataModel dstModel)
            throws DataFormatException
Description copied from class: ControlValuesCalculator
Calculates chart upper control limit data and fills given data model.

Specified by:
getUCL in class ControlValuesCalculator
Parameters:
dataModel - input data model.
dstModel - upper control limit destination data model.
Throws:
DataFormatException - when the input data are invalid.

getAvgP

protected double getAvgP(ChartDataModel dataModel)
                  throws DataFormatException
Calculates he average p value.

Parameters:
dataModel - input data model.
Returns:
average p value.
Throws:
DataFormatException - when input data are invalid.

validateDataModel

protected void validateDataModel(ChartDataModel dataModel)
                          throws DataFormatException
Description copied from class: ValuesCalculator
Validates data model. Checks if it satisfies chart type requirements.

Specified by:
validateDataModel in class ValuesCalculator
Parameters:
dataModel - input chart data model.
Throws:
DataFormatException - when the data is invalid.