Package org.dashbuilder.dataset
Interface DataSet
-
- All Known Implementing Classes:
DataSetImpl
public interface DataSet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DataSetaddColumn(String id, ColumnType type)Add a brand new column.DataSetaddColumn(String id, ColumnType type, List values)Add a brand new column populated with the given values.DataSetaddColumn(DataColumn column)Add a brand new column.DataSetaddEmptyRowAt(int row)Add an empty row at the given position.DataSetaddValues(Object... values)Add a row at the end of the data set.DataSetaddValuesAt(int row, Object... values)Add a row at the given position.DataSetcloneEmpty()Build a data set with the same structure as this but containing no data.DataSetcloneInstance()Build a data set with the same structure and content.DataColumngetColumnById(String id)Get a column by its id.DataColumngetColumnByIndex(int index)Get a column by its index (starting at 0).intgetColumnIndex(DataColumn dataColumn)Get a column's internal DataSet index.List<DataColumn>getColumns()The dataset columnsDategetCreationDate()The creation dateDataSetDefgetDefinition()The data set definitionlonggetEstimatedSize()Return the estimated memory (in bytes) the data set is consuming.DataSetMetadatagetMetadata()The metadataintgetRowCount()Get the number of rows in the dataset.intgetRowCountNonTrimmed()If this data set is the result of a trim operation this method will return the total number of rows existing before trim.StringgetUUID()The unique data set identifier.ObjectgetValueAt(int row, int column)Get the value at a given cell.ObjectgetValueAt(int row, String columnId)Get the value at a given cell.DataSetremoveColumn(String id)Removes an existing column.voidsetColumns(List<DataColumn> columnList)voidsetCreationDate(Date date)The creation datevoidsetDefinition(DataSetDef def)The data set definitionvoidsetRowCountNonTrimmed(int count)If this data set is the result of a trim operation this method will return the total number of rows existing before trim.voidsetUUID(String uuid)Set an unique identifier to this data set.DataSetsetValueAt(int row, int column, Object value)Set the value at a given cell.DataSetsetValuesAt(int row, Object... values)Set all the values for a given row.DataSettrim(int offset, int rows)Returns a data set containing only the specified row sub set.DataSettrim(List<Integer> rows)Returns a data set containing only the specified row sub set.
-
-
-
Method Detail
-
getMetadata
DataSetMetadata getMetadata()
The metadata
-
getDefinition
DataSetDef getDefinition()
The data set definition
-
setDefinition
void setDefinition(DataSetDef def)
The data set definition
-
getUUID
String getUUID()
The unique data set identifier.
-
setUUID
void setUUID(String uuid)
Set an unique identifier to this data set.
-
getCreationDate
Date getCreationDate()
The creation date
-
setCreationDate
void setCreationDate(Date date)
The creation date
-
getColumns
List<DataColumn> getColumns()
The dataset columns
-
setColumns
void setColumns(List<DataColumn> columnList)
-
getColumnById
DataColumn getColumnById(String id)
Get a column by its id.
-
getColumnByIndex
DataColumn getColumnByIndex(int index)
Get a column by its index (starting at 0).
-
getColumnIndex
int getColumnIndex(DataColumn dataColumn)
Get a column's internal DataSet index.
-
addColumn
DataSet addColumn(String id, ColumnType type)
Add a brand new column.
-
addColumn
DataSet addColumn(String id, ColumnType type, List values)
Add a brand new column populated with the given values.
-
addColumn
DataSet addColumn(DataColumn column)
Add a brand new column.
-
getRowCount
int getRowCount()
Get the number of rows in the dataset.
-
getValueAt
Object getValueAt(int row, int column)
Get the value at a given cell.- Parameters:
row- The cell row (the first row is 0).column- The cell column (the first column is 0).
-
getValueAt
Object getValueAt(int row, String columnId)
Get the value at a given cell.- Parameters:
row- The cell row (the first row is 0).columnId- The cell column id.
-
setValueAt
DataSet setValueAt(int row, int column, Object value)
Set the value at a given cell.- Parameters:
row- The cell row (the first row is 0).column- The cell column (the first column is 0).
-
setValuesAt
DataSet setValuesAt(int row, Object... values)
Set all the values for a given row.- Parameters:
row- The cell row (the first row is 0).
-
addValuesAt
DataSet addValuesAt(int row, Object... values)
Add a row at the given position.- Parameters:
row- The cell row (the first row is 0).
-
addEmptyRowAt
DataSet addEmptyRowAt(int row)
Add an empty row at the given position.- Parameters:
row- The cell row (the first row is 0).
-
trim
DataSet trim(int offset, int rows)
Returns a data set containing only the specified row sub set.- Parameters:
offset- The position where the row sub set starts (starting at 0).rows- The number of rows to get.- Returns:
- A trimmed data set.
-
trim
DataSet trim(List<Integer> rows)
Returns a data set containing only the specified row sub set.- Parameters:
rows- The row ordinals to add to the resulting data set.- Returns:
- A trimmed data set.
-
getRowCountNonTrimmed
int getRowCountNonTrimmed()
If this data set is the result of a trim operation this method will return the total number of rows existing before trim.- Returns:
- The total number of existing rows before any trim operation (if any) or -1 if no trim operation has been carried out.
-
setRowCountNonTrimmed
void setRowCountNonTrimmed(int count)
If this data set is the result of a trim operation this method will return the total number of rows existing before trim.
-
cloneEmpty
DataSet cloneEmpty()
Build a data set with the same structure as this but containing no data.
-
cloneInstance
DataSet cloneInstance()
Build a data set with the same structure and content.
-
getEstimatedSize
long getEstimatedSize()
Return the estimated memory (in bytes) the data set is consuming.- Returns:
- The number of bytes
-
-