JIDE 3.5.15

com.jidesoft.pivot
Class BigDecimalSummaryCalculator

java.lang.Object
  extended by com.jidesoft.pivot.BigDecimalSummaryCalculator
All Implemented Interfaces:
SummaryCalculator

Deprecated. Please use DefaultSummaryCalculator instead as DefaultSummaryCalculator supports BigDecimal as well.

@Deprecated
public class BigDecimalSummaryCalculator
extends Object
implements SummaryCalculator

The implementation of SummaryCalculator for BigDecimal. In this implementation, we calculate seven statistics - Sum, Min, Max, Mean, Var, StdDev, Count.

Different from what is already in DefaultSummaryCalculator, some statistics calculations need a MathContext to control the precision. You can set it using setMathContext(java.math.MathContext). This context is used in Mean, Var, StdDev calculation.


Field Summary
 
Fields inherited from interface com.jidesoft.pivot.SummaryCalculator
ALLOWED_SUMMARIES_ALL, ALLOWED_SUMMARIES_COUNT, ALLOWED_SUMMARIES_MAX_MIN_COUNT
 
Constructor Summary
BigDecimalSummaryCalculator()
          Deprecated.  
BigDecimalSummaryCalculator(MathContext mathContext)
          Deprecated.  
 
Method Summary
 void addValue(IPivotDataModel pivotDataModel, PivotField pivotField, int row, int column, Object object)
          Deprecated. Adds a value for calculation.
 void addValue(Object object)
          Deprecated. Adds a value for calculation.
 void addValue(PivotValueProvider valueProvider, PivotField field, Object object)
          Deprecated. Adds a value for calculation..
 void addValue(PivotValueProvider dataModel, PivotField field, Values rowValues, Values columnValues, Object object)
          Deprecated. Adds a value for calculation.
 void clear()
          Deprecated. Clears all previous added values.
 int[] getAllowedSummaries(Class<?> type)
          Deprecated. Gets the allowed summary types for a data type.
 int[] getAllowedSummaries(Class<?> type, ConverterContext context)
          Deprecated. Gets the allowed summary types.
 long getCount()
          Deprecated. Gets the number of values that have been added so far.
 MathContext getMathContext()
          Deprecated. Gets the math context.
 int getNumberOfSummaries()
          Deprecated. Gets the number of summary types.
 String getSummaryName(Locale locale, int summarySort)
          Deprecated. Gets the summary name for the specified type.
 Object getSummaryResult(int summarySort)
          Deprecated. Gets the summary result for the specified type.
 boolean isBiasCorrected()
          Deprecated. Checks if the biasCorrect is set.
 void setBiasCorrected(boolean biasCorrected)
          Deprecated. Sets the biasCorrected flag.
 void setMathContext(MathContext mathContext)
          Deprecated. Sets the math context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigDecimalSummaryCalculator

public BigDecimalSummaryCalculator()
Deprecated. 

BigDecimalSummaryCalculator

public BigDecimalSummaryCalculator(MathContext mathContext)
Deprecated. 
Method Detail

getMathContext

public MathContext getMathContext()
Deprecated. 
Gets the math context. This is used when calculating mean, var and stddev.

Returns:
the MathContext.

setMathContext

public void setMathContext(MathContext mathContext)
Deprecated. 
Sets the math context. This is used when calculating mean, var and stddev.

Parameters:
mathContext - a new MathContext.

addValue

public void addValue(Object object)
Deprecated. 
Description copied from interface: SummaryCalculator
Adds a value for calculation.

Specified by:
addValue in interface SummaryCalculator
Parameters:
object - the value

addValue

public void addValue(IPivotDataModel pivotDataModel,
                     PivotField pivotField,
                     int row,
                     int column,
                     Object object)
Deprecated. 
Description copied from interface: SummaryCalculator
Adds a value for calculation. Different from SummaryCalculator.addValue(Object) which only takes the value as parameter, this method provides PivotDataModel, PivotField and row/column index of the cell as in the DataTableModel.

Specified by:
addValue in interface SummaryCalculator
Parameters:
pivotDataModel - the PivotDataModel
pivotField - the PivotField
row - the row index as in the PivotDataModel#getDataTableModel. It could be -1 if the row index is not available.
column - the column index as in the PivotDataModel#getDataTableModel. It could be -1 if the column index is not available.
object - the value

addValue

public void addValue(PivotValueProvider valueProvider,
                     PivotField field,
                     Object object)
Deprecated. 
Description copied from interface: SummaryCalculator
Adds a value for calculation..

Specified by:
addValue in interface SummaryCalculator
Parameters:
valueProvider - the PivotValueProvider
field - the PivotField
object - the value

addValue

public void addValue(PivotValueProvider dataModel,
                     PivotField field,
                     Values rowValues,
                     Values columnValues,
                     Object object)
Deprecated. 
Description copied from interface: SummaryCalculator
Adds a value for calculation. Different from SummaryCalculator.addValue(Object) which only takes the value as parameter, this method provides PivotValueProvider, PivotField and row/column values of the cell as in the DataTableModel.

To get the row indices in the original table model, please try to use the following code.

 ((IPivotDataModel) dataModel).getDataAt(((DefaultValues) rowValues).toCompoundKey(), ((DefaultValues) columnValues).toCompoundKey());
 

Specified by:
addValue in interface SummaryCalculator
Parameters:
dataModel - the PivotDataModel
field - the PivotField
rowValues - the row values corresponding to the cell to calculate.
columnValues - the column values corresponding to the cell to calculate.
object - the value

clear

public void clear()
Deprecated. 
Description copied from interface: SummaryCalculator
Clears all previous added values.

Specified by:
clear in interface SummaryCalculator

getCount

public long getCount()
Deprecated. 
Description copied from interface: SummaryCalculator
Gets the number of values that have been added so far.

Specified by:
getCount in interface SummaryCalculator
Returns:
the number of values that have been added so far.

getNumberOfSummaries

public int getNumberOfSummaries()
Deprecated. 
Description copied from interface: SummaryCalculator
Gets the number of summary types.

Specified by:
getNumberOfSummaries in interface SummaryCalculator
Returns:
the number of statistic types.

getSummaryName

public String getSummaryName(Locale locale,
                             int summarySort)
Deprecated. 
Description copied from interface: SummaryCalculator
Gets the summary name for the specified type.

Specified by:
getSummaryName in interface SummaryCalculator
Parameters:
locale - the current locale
Returns:
the summary name.

getSummaryResult

public Object getSummaryResult(int summarySort)
Deprecated. 
Description copied from interface: SummaryCalculator
Gets the summary result for the specified type.

Specified by:
getSummaryResult in interface SummaryCalculator
Returns:
the summary result for the specified type.

isBiasCorrected

public boolean isBiasCorrected()
Deprecated. 
Checks if the biasCorrect is set.

Returns:
true or false.

setBiasCorrected

public void setBiasCorrected(boolean biasCorrected)
Deprecated. 
Sets the biasCorrected flag. If true, variance will be calculated dividing by n - 1. Otherwise, it willdividee by n. Default is true.

Parameters:
biasCorrected - true or false.

getAllowedSummaries

public int[] getAllowedSummaries(Class<?> type)
Deprecated. 
Description copied from interface: SummaryCalculator
Gets the allowed summary types for a data type.

Specified by:
getAllowedSummaries in interface SummaryCalculator
Parameters:
type - the data type.
Returns:
the allowed summary types.

getAllowedSummaries

public int[] getAllowedSummaries(Class<?> type,
                                 ConverterContext context)
Deprecated. 
Gets the allowed summary types.

Specified by:
getAllowedSummaries in interface SummaryCalculator
Parameters:
type - the data type.
context - the converter context. If the type is the same and you want it to have different summary types, you can use the converter context to make them different.
Returns:
the allowed summary types.

JIDE 3.5.15