de.grogra.pf.data
Class Dataset

java.lang.Object
  extended by de.grogra.pf.data.Dataset
All Implemented Interfaces:
Shareable, Showable, java.io.Serializable

public final class Dataset
extends java.lang.Object
implements Shareable, java.io.Serializable, Showable

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:
Serialized Form

Field Summary
static MimeType MIME_TYPE
           
 
Constructor Summary
Dataset()
           
 
Method Summary
 Dataseries addColumn()
          Adds a new column to this dataset and returns it as a dataseries.
 Dataseries addColumn(java.lang.Comparable key)
          Adds a new column to this dataset and returns it as a dataseries.
 void addReference(SharedObjectReference ref)
           
 Dataseries addRow()
          Adds a new row to this dataset and returns it as a dataseries.
 Dataseries addRow(java.lang.Comparable key)
          Adds a new row to this dataset and returns it as a dataseries.
 void appendReferencesTo(java.util.List out)
           
 DatasetAdapter asDatasetAdapter()
          Returns a view of this dataset as an instance of DatasetAdapter.
 javax.swing.table.TableModel asTableModel()
          Returns a view of this dataset as an instance of TableModel.
 Dataset clear()
          Clears this dataset.
static void export(Item item, java.lang.Object info, Context context)
           
 java.lang.String getCategoryLabel()
           
 Datacell getCell(int row, int col)
          Returns the datacell at row and column.
 Dataseries getColumn(int column)
          Returns column as a dataseries.
 int getColumnCount()
          Returns the number of columns of this dataset.
 int getColumnCount(int row)
          Returns the number of columns which are defined in row.
 java.lang.Comparable getColumnKey(int column)
          Returns the key for the column with index column.
 org.jfree.data.DomainOrder getDomainOrder()
           
 org.jfree.data.general.DatasetGroup getGroup()
           
 SharedObjectProvider getProvider()
           
 Dataseries getRow(int row)
          Returns row as a dataseries.
 int getRowCount()
          Returns the number of rows of this dataset.
 int getRowCount(int column)
           
 java.lang.Comparable getRowKey(int row)
          Returns the key for the row with index row.
 java.lang.String getTitle()
           
 java.lang.String getValueLabel()
           
 boolean hasCell(int row, int col)
           
 boolean hasSeriesInRows()
           
 void initProvider(SharedObjectProvider provider)
           
 Dataseries operator$shl(double[] v)
           
 Dataseries operator$shl(java.lang.Number v)
           
 void removeReference(SharedObjectReference ref)
           
 Dataset setCategoryLabel(java.lang.String s)
           
 Dataset setColumnKey(int col, java.lang.Comparable key)
          Sets the key for column with index column to key
 void setDomainOrder(org.jfree.data.DomainOrder order)
           
 void setGroup(org.jfree.data.general.DatasetGroup group)
           
 Dataset setHistogramBins(int col, double min, double max, int count)
           
 Dataset setHistogramBins(int col, java.util.List<org.jfree.data.statistics.HistogramBin> bins)
           
 Dataset setRowKey(int row, java.lang.Comparable key)
          Sets the key for row with index row to key
 Dataset setSeriesInRows(boolean value)
           
 Dataset setTitle(java.lang.String s)
           
 Dataset setValueLabel(java.lang.String s)
           
 void show(Context ctx)
           
 void showInPanel(Panel panel)
           
 HistogramAdapter toHistogram()
          Returns a histogram of this dataset.
 StatisticsAdapter toStatistics()
          Returns a statistics view of this dataset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_TYPE

public static final MimeType MIME_TYPE
Constructor Detail

Dataset

public Dataset()
Method Detail

addColumn

public Dataseries addColumn()
Adds a new column to this dataset and returns it as a dataseries.

Returns:
added column as a dataseries

addColumn

public Dataseries addColumn(java.lang.Comparable key)
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

addReference

public void addReference(SharedObjectReference ref)
Specified by:
addReference in interface Shareable

addRow

public Dataseries addRow()
Adds a new row to this dataset and returns it as a dataseries.

Returns:
added row as a dataseries

addRow

public Dataseries addRow(java.lang.Comparable key)
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

appendReferencesTo

public void appendReferencesTo(java.util.List out)
Specified by:
appendReferencesTo in interface Shareable

asDatasetAdapter

public DatasetAdapter asDatasetAdapter()
Returns a view of this dataset as an instance of DatasetAdapter. Note that the meanings of rows and columns are exchanged.

Returns:
dataset as a DatasetAdapter

asTableModel

public javax.swing.table.TableModel asTableModel()
Returns a view of this dataset as an instance of TableModel.

Returns:
dataset as a TableModel

clear

public Dataset clear()
Clears this dataset. This removes all rows, columns, and their keys.

Returns:
this dataset

export

public static void export(Item item,
                          java.lang.Object info,
                          Context context)

getCategoryLabel

public java.lang.String getCategoryLabel()

getCell

public Datacell getCell(int row,
                        int col)
Returns the datacell at row and column. The rows and columns are extended if necessary.

Parameters:
row - row index of cell
col - column index of cell
Returns:
datacell at specified location

getColumn

public Dataseries getColumn(int column)
Returns column as a dataseries.

Parameters:
column - column index
Returns:
specified column represented as a dataseries

getColumnCount

public int getColumnCount()
Returns the number of columns of this dataset.

Returns:
number of columns
See Also:
getColumnCount(int)

getColumnCount

public int getColumnCount(int row)
Returns the number of columns which are defined in row. The returned value does not exceed getColumnCount().

Parameters:
row - row index
Returns:
number of columns in row

getColumnKey

public java.lang.Comparable getColumnKey(int column)
Returns the key for the column with index column. If such a key has not been set explicitly by setColumnKey(int, Comparable), an instance of Character is returned, its value being column + 'A'.

Parameters:
column - column index
Returns:
key for column

getDomainOrder

public org.jfree.data.DomainOrder getDomainOrder()

getGroup

public org.jfree.data.general.DatasetGroup getGroup()

getProvider

public SharedObjectProvider getProvider()
Specified by:
getProvider in interface Shareable

getRow

public Dataseries getRow(int row)
Returns row as a dataseries.

Parameters:
row - row index
Returns:
specified row represented as a dataseries

getRowCount

public int getRowCount()
Returns the number of rows of this dataset.

Returns:
number of rows

getRowCount

public int getRowCount(int column)

getRowKey

public java.lang.Comparable getRowKey(int row)
Returns the key for the row with index row. If such a key has not been set explicitly by setRowKey(int, Comparable), an instance of Integer is returned, its value being row + 1.

Parameters:
row - row index
Returns:
key for row

getTitle

public java.lang.String getTitle()

getValueLabel

public java.lang.String getValueLabel()

hasCell

public boolean hasCell(int row,
                       int col)

hasSeriesInRows

public boolean hasSeriesInRows()

initProvider

public void initProvider(SharedObjectProvider provider)
Specified by:
initProvider in interface Shareable

operator$shl

public Dataseries operator$shl(double[] v)

operator$shl

public Dataseries operator$shl(java.lang.Number v)

removeReference

public void removeReference(SharedObjectReference ref)
Specified by:
removeReference in interface Shareable

setCategoryLabel

public Dataset setCategoryLabel(java.lang.String s)

setColumnKey

public Dataset setColumnKey(int col,
                            java.lang.Comparable key)
Sets the key for column with index column to key

Parameters:
col - column index
key - key for column
Returns:
this dataset
See Also:
getColumnKey(int)

setDomainOrder

public void setDomainOrder(org.jfree.data.DomainOrder order)

setGroup

public void setGroup(org.jfree.data.general.DatasetGroup group)

setHistogramBins

public Dataset setHistogramBins(int col,
                                double min,
                                double max,
                                int count)

setHistogramBins

public Dataset setHistogramBins(int col,
                                java.util.List<org.jfree.data.statistics.HistogramBin> bins)

setRowKey

public Dataset setRowKey(int row,
                         java.lang.Comparable key)
Sets the key for row with index row to key

Parameters:
row - row index
key - key for row
Returns:
this dataset
See Also:
getRowKey(int)

setSeriesInRows

public Dataset setSeriesInRows(boolean value)

setTitle

public Dataset setTitle(java.lang.String s)

setValueLabel

public Dataset setValueLabel(java.lang.String s)

show

public void show(Context ctx)
Specified by:
show in interface Showable

showInPanel

public void showInPanel(Panel panel)

toHistogram

public HistogramAdapter toHistogram()
Returns a histogram of this dataset.

Returns:
dataset as a DatasetAdapter

toStatistics

public StatisticsAdapter toStatistics()
Returns a statistics view of this dataset.

Returns:
dataset as a StatisticsAdapter