|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PivotDataSource
By default, PivotDataModel takes TableModel as the data source. By providing this interface, it is possible to use any compatible data as the data source for PivotDataModel. PivotDataSource also provides methods related to filtering. If you use this interface, you can totally skip the FilterableTableModel we used internally in PivotDataModel. If you can provide a more efficient filtering engine to implement this interface in the right way, it could make the pivot table faster.
Method Summary | |
---|---|
void |
addTableModelListener(TableModelListener listener)
Adds the table model listener. |
void |
applyFilters()
Tells the data source to apply the filters after all filters have been set using setFilter(Object[],int,boolean) method. |
void |
applyFilters(int[] rowFieldIndices,
int[] columnFieldIndices,
int[] dataFieldIndices,
int[] filterFieldIndices)
Tells the data source to apply the filters after all filters have been set using setFilter(Object[],int,boolean) method. |
void |
clearFilters()
Tells the data source to clear all existing filters so that we can start to use setFilter(Object[],int,boolean) method to set the filters. |
int |
getActualRowIndex(int visualRowIndex)
Gets the actual row index in the original table model. |
int |
getFieldCount()
Gets number of fields in this data source. |
String |
getFieldName(int fieldIndex)
Gets the field name. |
String |
getFieldTitle(int fieldIndex)
Gets the field title. |
Class<?> |
getFieldType(int fieldIndex)
Gets the field type. |
int |
getFilteredRowIndex(int actualRowIndex)
Gets the row index after filtering so that we can use getValueAt(int,int) or setValueAt(Object,int,int) methods. |
Set<Object> |
getPossibleValues(int fieldIndex,
boolean filterField,
boolean isNullAllowed)
Gets the possible values for the field. |
int |
getRowCount()
Gets the row count. |
Object |
getValueAt(int rowIndex,
int fieldIndex)
Gets the value at the specified field index and the row index. |
boolean |
hasFilter()
Get if the data source has filter applying on it. |
void |
removeTableModelListener(TableModelListener listener)
Removes the table model listener that was added earlier. |
void |
setExcludeFilter(Object[] values,
int fieldIndex,
boolean filterField)
Sets the deselected possible values for the field. |
void |
setFilter(Filter filter,
int fieldIndex,
boolean filterField)
Sets the Filter for the field. |
void |
setFilter(Object[] values,
int fieldIndex,
boolean filterField)
Sets the possible values for the field. |
void |
setValueAt(Object value,
int rowIndex,
int fieldIndex)
Gets the value at the specified field index and the row index. |
Method Detail |
---|
int getFieldCount()
String getFieldName(int fieldIndex)
fieldIndex
- the field index.
String getFieldTitle(int fieldIndex)
fieldIndex
- the field index.
Class<?> getFieldType(int fieldIndex)
fieldIndex
- the field index.
int getRowCount()
Object getValueAt(int rowIndex, int fieldIndex)
rowIndex
- the row index. It is the index after filtering.fieldIndex
- the field index.
void setValueAt(Object value, int rowIndex, int fieldIndex)
value
- the new value.fieldIndex
- the field index.rowIndex
- the row index. It is the index after filtering.Set<Object> getPossibleValues(int fieldIndex, boolean filterField, boolean isNullAllowed)
fieldIndex
- the field index.filterField
- whether the field is a filter field. If true, possible values will all values as in the
original data source. If false, the rows will be filtered first based on the setFilter(Object[],int,boolean)
and then collect all the possible values.isNullAllowed
- whether null value is allowed.
void clearFilters()
setFilter(Object[],int,boolean)
method to set the filters.
boolean hasFilter()
void setFilter(Object[] values, int fieldIndex, boolean filterField)
values
- the possible values.filterField
- whether the field is a filter field.fieldIndex
- the field index.void setExcludeFilter(Object[] values, int fieldIndex, boolean filterField)
values
- the deselected possible values.filterField
- whether the field is a filter field.fieldIndex
- the field index.void setFilter(Filter filter, int fieldIndex, boolean filterField)
filter
- the Filter.filterField
- whether the field is a filter field.fieldIndex
- the field index.void applyFilters(int[] rowFieldIndices, int[] columnFieldIndices, int[] dataFieldIndices, int[] filterFieldIndices)
setFilter(Object[],int,boolean)
method. This method tells you the field indices of each area. In
TableModelPivotDataSource implementation, we simply call applyFilters()
as that implementation doesn't
need to know the field indices.
rowFieldIndices
- the field indices for row fields.columnFieldIndices
- the field indices for column fields.dataFieldIndices
- the field indices for data fields.filterFieldIndices
- the field indices for filter fields.void applyFilters()
setFilter(Object[],int,boolean)
method. If you need to know the field indices of each area, you can override
other applyFilters method with four int[] parameters.
int getFilteredRowIndex(int actualRowIndex)
getValueAt(int,int)
or setValueAt(Object,int,int)
methods.
actualRowIndex
- the actual row index.
int getActualRowIndex(int visualRowIndex)
PivotDataModel.getDataAt(int, int)
method.
visualRowIndex
- the visual row index.
void addTableModelListener(TableModelListener listener)
listener
- the table model listener to be added.void removeTableModelListener(TableModelListener listener)
listener
- the table model listener to be removed.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |