public interface AQDataSet
Sorting
This data set object supports sorting. In order to sort the set, sorting criteria must be established by
calling setSorting*** method for a desired column, followed by sort()
method.
The sorting criteria can be set for more than one
column, in which case the sorting priority will be determined by the order of setSorting*** calls.
Sorting re-orders data rows within the data set.
Modifier and Type | Method and Description |
---|---|
void |
add(AQDataRow row)
Append a new row at the end of the data set.
|
AQDataRow |
addRow()
Add a new row to the end of the list of rows.
|
AQDataRow |
addRowWithValues(Object... values)
Add a new row with the specified column values at the end of the data set.
|
void |
append(AQDataSet data)
Appends another data set.
|
void |
clear()
Removes all of the elements from this list.
|
void |
clearSorting()
Clears the sorting criteria set on the columns previously with setSortingXXX() methods.
|
AQDataRow |
get(int index)
Returns the data row at the specified position.
|
byte[] |
getAsExcel2003()
Returns the data set as a byte array representing an Excel 2003 file.
|
byte[] |
getAsExcel2003(AQDataSetSettings settings,
AQChart chart)
Returns the data set, with chart enabled, as a byte array representing an Excel 2003 file.
|
byte[] |
getAsExcel2007()
Returns the data set as a byte array representing an Excel 2007 file.
|
byte[] |
getAsExcel2007(AQDataSetSettings settings,
AQChart chart)
Returns the data set, with chart enabled, as a byte array representing an Excel 2007 file.
|
int |
getColumnCount()
Returns number of columns in this data set.
|
String[] |
getColumnNames()
Returns an array of column names.
|
AQColumnStructure |
getColumnStructure()
Returns column structure information.
|
AQDataReader |
getReader()
Creates a new reader (with its own cursor) suitable for sequential access.
|
int |
getRowCount()
Returns the number of rows in this data set.
|
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the data value at
columnIndex and
rowIndex . |
void |
importData(AQDataReader in)
Imports data row by row, performing necessary structural conversion.
|
void |
insert(int index,
AQDataRow row)
Insert row at the specified index.
|
AQDataRow |
insertRow(int index)
Insert a new row at specified index.
|
AQDataRow |
insertRowWithValues(int index,
Object... values)
Insert a new row at specified index with the specified column values.
|
boolean |
isSortingAscending(int column)
Returns true if the specified column has been configured for sorting in ascending direction.
|
boolean |
isSortingAscending(String column)
Returns true if the specified column has been configured for sorting in ascending direction.
|
boolean |
isSortingDescending(int column)
Returns true if the specified column has been configured for sorting in descending direction.
|
boolean |
isSortingDescending(String column)
Returns true if the specified column has been configured for sorting in descending direction.
|
boolean |
isSortingNone(int column)
Returns true if the specified column has no sorting configured.
|
boolean |
isSortingNone(String column)
Returns true if the specified column has no sorting configured.
|
void |
read(AQDataReader in)
Reads in data from a data stream.
|
AQDataRow |
remove(int index)
Removes the element at the specified position in the data set.
|
String |
renderHtml()
Converts the data set to a HTML document using the default grid
settings . |
String |
renderHtml(AQDataSetSettings settings)
Converts the data set to a HTML document using the specified grid
settings . |
String |
renderHtml(AQDataSetSettings settings,
AQChart chart)
Converts the data set to a HTML document, with chart enabled, using the specified grid
settings . |
String |
renderText()
Converts the data set to a formatted plain text grid using the default
grid settings . |
String |
renderText(AQDataSetSettings settings)
Converts the data set to a formatted plain text grid using the specified grid
settings . |
String |
renderText(int lineCount)
Converts the data set, up to
lineCount rows, to a formatted plain text grid using the default
grid settings . |
void |
saveAsExcel2003(String filename)
Saves the data set to an Excel2003 file.
|
void |
saveAsExcel2003(String fileName,
AQDataSetSettings settings,
AQChart chart)
Saves the data set, with chart enabled, as an Excel 2003 file.
|
void |
saveAsExcel2007(String filename)
Saves the data set to an Excel2007 file.
|
void |
saveAsExcel2007(String fileName,
AQDataSetSettings settings,
AQChart chart)
Saves the data set, with chart enabled, as an Excel 2007 file.
|
void |
setColumnNames(String[] columnNames)
Sets column names.
|
void |
setSortingAscending(int column)
Sets ascending sorting direction for the specified column.
|
void |
setSortingAscending(String column)
Sets ascending sorting direction for the specified column.
|
void |
setSortingCollator(int column,
Collator collator)
Sets collator for the specified column.
|
void |
setSortingCollator(String column,
Collator collator)
Sets collator for the specified column.
|
void |
setSortingDescending(int column)
Sets descending sorting direction for the specified column.
|
void |
setSortingDescending(String column)
Sets descending sorting direction for the specified column.
|
void |
setSortingNone(int column)
Sets no sorting for the specified column, discarding any sorting options set for that column.
|
void |
setSortingNone(String column)
Sets no sorting for the specified column, discarding any sorting options set for that column.
|
void |
setSortingUseToString(int column,
boolean useToString)
Sets whether sorting should use binary value or toString() representation.
|
void |
setSortingUseToString(String column,
boolean useToString)
Sets whether sorting should use binary value or toString() representation.
|
void |
sort()
Sorts data set using sorting criteria configured previously by calls to
setSortingXXX() methods.
|
void |
sort(int column,
boolean ascending)
Sorts the data set using natural ordering.
|
void |
sort(int column,
boolean ascending,
Comparator comparator)
Sorts the data set using specified comparator.
|
void |
sort(String column,
boolean ascending)
Sorts the data set using natural ordering.
|
void |
sort(String column,
boolean ascending,
Comparator comparator)
Sorts the data set using specified comparator.
|
void read(AQDataReader in) throws Exception
importData(com.aquafold.openapi.io.AQDataReader)
instead.in
- Source data reader.Exception
- On errorAQDataReader getReader()
AQColumnStructure getColumnStructure()
void setColumnNames(String[] columnNames)
columnNames
- Column names.String[] getColumnNames()
void add(AQDataRow row)
row
- Source data row.void insert(int index, AQDataRow row)
index
- 0-based row index.row
- Source data row.AQDataRow addRow()
AQDataRow insertRow(int index)
index
- 0-based index at which new row is inserted.AQDataRow addRowWithValues(Object... values)
values
- Vararg sequence of column values for the new row.AQDataRow insertRowWithValues(int index, Object... values)
index
- 0-based index at which new row is inserted.values
- Vararg sequence of column values for the new row.AQDataRow get(int index)
index
- 0-based row index.AQDataRow remove(int index)
index
- 0-based row index.void clear()
int getRowCount()
int getColumnCount()
void importData(AQDataReader in) throws Exception
in
- Source data reader.Exception
- On errorvoid append(AQDataSet data) throws Exception
data
- Source data set.Exception
- On errorvoid sort(String column, boolean ascending)
column
- Column name.ascending
- Sort order.void sort(int column, boolean ascending)
column
- Column index.ascending
- Sort order.void sort(String column, boolean ascending, Comparator comparator)
column
- Column name.ascending
- Sort order.comparator
- Comparator to use.void sort(int column, boolean ascending, Comparator comparator)
column
- Column index.ascending
- Sort order.comparator
- Comparator to use.void setSortingAscending(String column)
sort()
to actually sort the data.column
- Column name.void setSortingAscending(int column)
sort()
to actually sort the data.column
- Column index.void setSortingDescending(String column)
sort()
to actually sort the data.column
- Column name.void setSortingDescending(int column)
sort()
to actually sort the data.column
- Column index.void setSortingNone(String column)
sort()
to actually sort the data.column
- Column name.void setSortingNone(int column)
sort()
to actually sort the data.column
- Column index.boolean isSortingAscending(String column)
column
- Column name.boolean isSortingAscending(int column)
column
- Column index.boolean isSortingDescending(String column)
column
- Column name.boolean isSortingDescending(int column)
column
- Column index.boolean isSortingNone(String column)
column
- Column name.boolean isSortingNone(int column)
column
- Column index.void setSortingCollator(String column, Collator collator)
column
- Column name.collator
- Collatorvoid setSortingCollator(int column, Collator collator)
column
- Column index.collator
- Collatorvoid setSortingUseToString(String column, boolean useToString)
sort()
to actually sort the data.column
- Column name.useToString
- Turn option on/offvoid setSortingUseToString(int column, boolean useToString)
sort()
to actually sort the data.column
- Column index.useToString
- Turn option on/offvoid clearSorting()
void sort()
clearSorting()
has been called.
This method allows sorting using multiple columns.void saveAsExcel2003(String filename) throws Exception
filename
- File name.Exception
- On errorvoid saveAsExcel2003(String fileName, AQDataSetSettings settings, AQChart chart) throws Exception
fileName
- the name of the file where the data set to be savedsettings
- a data set settings, default settings are used if nullchart
- an object that describes how chart to be presented; ignored if nullException
- On errorbyte[] getAsExcel2003() throws Exception
Exception
- On errorbyte[] getAsExcel2003(AQDataSetSettings settings, AQChart chart) throws Exception
settings
- a data set settings, default settings are used if nullchart
- an object that describes how chart to be presented; ignored if nullException
- On errorvoid saveAsExcel2007(String filename) throws Exception
filename
- File name.Exception
- On errorvoid saveAsExcel2007(String fileName, AQDataSetSettings settings, AQChart chart) throws Exception
fileName
- the name of the file where the data set to be savedsettings
- a data set settings, default settings are used if nullchart
- an object that describes how chart to be presented; ignored if nullException
- On errorbyte[] getAsExcel2007() throws Exception
Exception
- On errorbyte[] getAsExcel2007(AQDataSetSettings settings, AQChart chart) throws Exception
settings
- a data set settings, default settings are used if nullchart
- an object that describes how chart to be presented; ignored if nullException
- On errorObject getValueAt(int rowIndex, int columnIndex)
columnIndex
and
rowIndex
. This method returns null instead of throwing an exception
when row or column index are outside of the data set range.rowIndex
- 0-based row index.columnIndex
- 0-based column index.String renderText()
grid settings
.String renderText(int lineCount)
lineCount
rows, to a formatted plain text grid using the default
grid settings
.lineCount
- the maximum number of rows to displayString renderText(AQDataSetSettings settings)
settings
.settings
- a grid settingsString renderHtml()
settings
.String renderHtml(AQDataSetSettings settings)
settings
.settings
- a grid settingsString renderHtml(AQDataSetSettings settings, AQChart chart)
settings
.settings
- a grid settingschart
- an object that describes how chart to be presented; ignored if null
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.