java.lang.Object
de.grogra.pf.data.Dataset
- All Implemented Interfaces:
Shareable,Showable,Serializable
A
Dataset contains a set of Datacells
which are arranged in a tabular scheme, i.e., in rows and columns.- Author:
- Ole Kniemeyer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a new column to this dataset and returns it as a dataseries.addColumn(Comparable key) Adds a new column to this dataset and returns it as a dataseries.voidaddRow()Adds a new row to this dataset and returns it as a dataseries.addRow(Comparable key) Adds a new row to this dataset and returns it as a dataseries.voidappendReferencesTo(List out) Returns a view of this dataset as an instance ofDatasetAdapter.Returns a view of this dataset as an instance ofTableModel.clear()Clears this dataset.static voidvoidexport(FileWriter file, String separator) Writes the data of this data set to the indicated file.voidexport(StringBuffer sb, String separator) getCell(int row, int col) Returns the datacell atrowandcolumn.getColumn(int column) Returnscolumnas a dataseries.intReturns the number of columns of this dataset.intgetColumnCount(int row) Returns the number of columns which are defined inrow.getColumnKey(int column) Returns the key for the column with indexcolumn.getGroup()getRow(int row) Returnsrowas a dataseries.intReturns the number of rows of this dataset.intgetRowCount(int column) getRowKey(int row) Returns the key for the row with indexrow.getTitle()booleanhasCell(int row, int col) booleanvoidinitProvider(SharedObjectProvider provider) operator$shl(double[] v) voidsetColumnKey(int col, Comparable key) Sets the key for column with indexcolumntokeyvoidsetDomainOrder(DomainOrder order) voidsetGroup(DatasetGroup group) setHistogramBins(int col, double min, double max, int count) setHistogramBins(int col, List<HistogramBin> bins) setRowKey(int row, Comparable key) Sets the key for row with indexrowtokeysetSeriesInRows(boolean value) voidvoidshowInPanel(Panel panel) Returns a histogram of this dataset.Returns a statistics view of this dataset.
-
Field Details
-
MIME_TYPE
-
-
Constructor Details
-
Dataset
public Dataset()
-
-
Method Details
-
asDatasetAdapter
Returns a view of this dataset as an instance ofDatasetAdapter. Note that the meanings of rows and columns are exchanged.- Returns:
- dataset as a
DatasetAdapter
-
toHistogram
Returns a histogram of this dataset.- Returns:
- dataset as a
DatasetAdapter
-
toStatistics
Returns a statistics view of this dataset.- Returns:
- dataset as a
StatisticsAdapter
-
asTableModel
Returns a view of this dataset as an instance ofTableModel.- Returns:
- dataset as a
TableModel
-
getProvider
- Specified by:
getProviderin interfaceShareable
-
appendReferencesTo
- Specified by:
appendReferencesToin interfaceShareable
-
getGroup
-
setGroup
-
setSeriesInRows
-
hasSeriesInRows
public boolean hasSeriesInRows() -
clear
Clears this dataset. This removes all rows, columns, and their keys.- Returns:
- this dataset
-
getCell
Returns the datacell atrowandcolumn. The rows and columns are extended if necessary.- Parameters:
row- row index of cellcol- column index of cell- Returns:
- datacell at specified location
-
hasCell
public boolean hasCell(int row, int col) -
getDomainOrder
-
setDomainOrder
-
getTitle
-
setTitle
-
getCategoryLabel
-
setCategoryLabel
-
getValueLabel
-
setValueLabel
-
getRowCount
public int getRowCount()Returns the number of rows of this dataset.- Returns:
- number of rows
-
getRowCount
public int getRowCount(int column) -
getColumnCount
public int getColumnCount()Returns the number of columns of this dataset.- Returns:
- number of columns
- See Also:
-
getColumnCount
public int getColumnCount(int row) Returns the number of columns which are defined inrow. The returned value does not exceedgetColumnCount().- Parameters:
row- row index- Returns:
- number of columns in
row
-
getRow
Returnsrowas a dataseries.- Parameters:
row- row index- Returns:
- specified row represented as a dataseries
-
getColumn
Returnscolumnas a dataseries.- Parameters:
column- column index- Returns:
- specified column represented as a dataseries
-
addRow
Adds a new row to this dataset and returns it as a dataseries.- Returns:
- added row as a dataseries
-
addColumn
Adds a new column to this dataset and returns it as a dataseries.- Returns:
- added column as a dataseries
-
addRow
Adds a new row to this dataset and returns it as a dataseries.- Parameters:
key- row key to use- Returns:
- added row as a dataseries
-
addColumn
Adds a new column to this dataset and returns it as a dataseries.- Parameters:
key- column key to use- Returns:
- added column as a dataseries
-
operator$shl
-
operator$shl
-
getRowKey
Returns the key for the row with indexrow. If such a key has not been set explicitly bysetRowKey(int, Comparable), an instance ofIntegeris returned, its value beingrow + 1.- Parameters:
row- row index- Returns:
- key for row
-
getColumnKey
Returns the key for the column with indexcolumn. If such a key has not been set explicitly bysetColumnKey(int, Comparable), an instance ofCharacteris returned, its value beingcolumn + 'A'.- Parameters:
column- column index- Returns:
- key for column
-
setRowKey
Sets the key for row with indexrowtokey- Parameters:
row- row indexkey- key for row- Returns:
- this dataset
- See Also:
-
setColumnKey
Sets the key for column with indexcolumntokey- Parameters:
col- column indexkey- key for column- Returns:
- this dataset
- See Also:
-
setHistogramBins
-
setHistogramBins
-
show
-
export
-
export
Writes the data of this data set to the indicated file.- Parameters:
file-separator- between the items of a column
-
showInPanel
-
export
-