Class SummationSummaryProvider
- All Implemented Interfaces:
ISummaryProvider
If a column contains mixed values, e.g. Strings and Integers, the
SummationSummaryProvider will return
ISummaryProvider.DEFAULT_SUMMARY_VALUE by default, as a summation is
not possible this way. You are able to change that behaviour by creating the
SummationSummaryProvider with the parameter strict set to false.
In that case the non Number values will be ignored.
-
Field Summary
Fields inherited from interface org.eclipse.nebula.widgets.nattable.summaryrow.ISummaryProvider
DEFAULT, DEFAULT_SUMMARY_VALUE, NONE -
Constructor Summary
ConstructorsConstructorDescriptionSummationSummaryProvider(IDataProvider dataProvider) Create a newSummationSummaryProviderby using the givenIDataProvider.SummationSummaryProvider(IDataProvider dataProvider, boolean strict) Create a newSummationSummaryProviderby using the givenIDataProviderand strict mode configuration. -
Method Summary
-
Constructor Details
-
SummationSummaryProvider
Create a newSummationSummaryProviderby using the givenIDataProvider.Using this constructor will set the
SummationSummaryProviderin strict mode which means that if a column contains non Number values,ISummaryProvider.DEFAULT_SUMMARY_VALUEwill be returned.- Parameters:
dataProvider- TheIDataProviderthat should be used to calculate the sum.
-
SummationSummaryProvider
Create a newSummationSummaryProviderby using the givenIDataProviderand strict mode configuration.Using this constructor will set the
SummationSummaryProviderin strict mode which means that if a column contains non Number values,ISummaryProvider.DEFAULT_SUMMARY_VALUEwill be returned.- Parameters:
dataProvider- TheIDataProviderthat should be used to calculate the sum.strict- If strict is set totrueand one or more of the values in the column is not of type Number, thenISummaryProvider.DEFAULT_SUMMARY_VALUEwill be returned. If strict is set tofalse, this method will return the sum of all the values in the column that are of type Number, ignoring the non Number values.
-
-
Method Details
-
summarize
Calculates the sum of the values in the column.- Specified by:
summarizein interfaceISummaryProvider- Parameters:
columnIndex- The column index of the column for which the summary should be calculated.- Returns:
- The sum of all Number values in the column as Double or
ISummaryProvider.DEFAULT_SUMMARY_VALUEif the column contains non Number values and this SummationSummaryProvider is configured to be strict.
-