java.lang.Object
de.grogra.pf.data.Dataset
- All Implemented Interfaces:
Shareable
,Showable
,Serializable
A
Dataset
contains a set of Datacell
s
which are arranged in a tabular scheme, i.e., in rows and columns.- Author:
- Ole Kniemeyer
- See Also:
-
Field Summary
-
Constructor Summary
-
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.void
addRow()
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.void
appendReferencesTo
(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 void
void
export
(FileWriter file, String separator) Writes the data of this data set to the indicated file.void
export
(StringBuffer sb, String separator) getCell
(int row, int col) Returns the datacell atrow
andcolumn
.getColumn
(int column) Returnscolumn
as a dataseries.int
Returns the number of columns of this dataset.int
getColumnCount
(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) Returnsrow
as a dataseries.int
Returns the number of rows of this dataset.int
getRowCount
(int column) getRowKey
(int row) Returns the key for the row with indexrow
.getTitle()
boolean
hasCell
(int row, int col) boolean
void
initProvider
(SharedObjectProvider provider) operator$shl
(double[] v) void
setColumnKey
(int col, Comparable key) Sets the key for column with indexcolumn
tokey
void
setDomainOrder
(DomainOrder order) void
setGroup
(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 indexrow
tokey
setSeriesInRows
(boolean value) void
void
showInPanel
(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:
getProvider
in interfaceShareable
-
appendReferencesTo
- Specified by:
appendReferencesTo
in 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 atrow
andcolumn
. 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
Returnsrow
as a dataseries.- Parameters:
row
- row index- Returns:
- specified row represented as a dataseries
-
getColumn
Returnscolumn
as 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 ofInteger
is 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 ofCharacter
is returned, its value beingcolumn + 'A'
.- Parameters:
column
- column index- Returns:
- key for column
-
setRowKey
Sets the key for row with indexrow
tokey
- Parameters:
row
- row indexkey
- key for row- Returns:
- this dataset
- See Also:
-
setColumnKey
Sets the key for column with indexcolumn
tokey
- 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
-