|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SummaryCalculator
An interface used to calculate the summary for pivot table.
The SummaryCalculator works like this. Basically clear() will be called first so that you can clear all saved information. Then addValue will be called for each object that we will calculate the statistics, you will collect them into a List or something like that. Then getSummaryResult(int summaryType) will be called which will return the statistics of all the values in the List that you saved so far until clear is called again to clear the List.
Field Summary | |
---|---|
static int[] |
ALLOWED_SUMMARIES_ALL
|
static int[] |
ALLOWED_SUMMARIES_COUNT
|
static int[] |
ALLOWED_SUMMARIES_MAX_MIN_COUNT
|
Method Summary | |
---|---|
void |
addValue(IPivotDataModel dataModel,
PivotField field,
int rowIndex,
int columnIndex,
Object value)
Deprecated. replaced by addValue(PivotValueProvider, PivotField, Values, Values, Object) |
void |
addValue(Object value)
Adds a value for calculation. |
void |
addValue(PivotValueProvider valueProvider,
PivotField field,
Object value)
Deprecated. replaced by addValue(PivotValueProvider, PivotField, Values, Values, Object) |
void |
addValue(PivotValueProvider dataModel,
PivotField field,
Values rowValues,
Values columnValues,
Object value)
Adds a value for calculation. |
void |
clear()
Clears all previous added values. |
int[] |
getAllowedSummaries(Class<?> type)
Gets the allowed summary types for a data type. |
int[] |
getAllowedSummaries(Class<?> type,
ConverterContext context)
Gets the allowed summary types for a data type. |
long |
getCount()
Gets the number of values that have been added so far. |
int |
getNumberOfSummaries()
Gets the number of summary types. |
String |
getSummaryName(Locale locale,
int type)
Gets the summary name for the specified type. |
Object |
getSummaryResult(int type)
Gets the summary result for the specified type. |
Field Detail |
---|
static final int[] ALLOWED_SUMMARIES_ALL
static final int[] ALLOWED_SUMMARIES_MAX_MIN_COUNT
static final int[] ALLOWED_SUMMARIES_COUNT
Method Detail |
---|
void addValue(Object value)
value
- the valuevoid addValue(PivotValueProvider dataModel, PivotField field, Values rowValues, Values columnValues, Object value)
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());
dataModel
- the PivotDataModelfield
- the PivotFieldrowValues
- the row values corresponding to the cell to calculate.columnValues
- the column values corresponding to the cell to calculate.value
- the value@Deprecated void addValue(IPivotDataModel dataModel, PivotField field, int rowIndex, int columnIndex, Object value)
addValue(PivotValueProvider, PivotField, Values, Values, Object)
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.
dataModel
- the PivotDataModelfield
- the PivotFieldrowIndex
- the row index as in the PivotDataModel#getDataTableModel. It could be -1 if the row index is
not available.columnIndex
- the column index as in the PivotDataModel#getDataTableModel. It could be -1 if the column
index is not available.value
- the value@Deprecated void addValue(PivotValueProvider valueProvider, PivotField field, Object value)
addValue(PivotValueProvider, PivotField, Values, Values, Object)
valueProvider
- the PivotValueProviderfield
- the PivotFieldvalue
- the valuevoid clear()
long getCount()
int getNumberOfSummaries()
String getSummaryName(Locale locale, int type)
locale
- the current localetype
-
Object getSummaryResult(int type)
type
-
int[] getAllowedSummaries(Class<?> type)
type
- the data type.
int[] getAllowedSummaries(Class<?> type, ConverterContext context)
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.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |