org.broadinstitute.genee.matrix
Interface Dataset

All Known Implementing Classes:
AbstractDataset, FixedSizeAbstractDataset, RowMajorArray2DDataset

public interface Dataset

The interface for a dataset consisting of a two-dimensional matrix of float values. A dataset may also optionally contain one or more series of two-dimensional matrices. A dataset also has metadata associated with each row and column.


Method Summary
 int getColumnCount()
          Returns the number of columns in the dataset.
 MetadataModel getColumnMetadata()
          Gets the column metadata for this dataset.
 String getName()
          Returns the name of this dataset.
 Object getObjectValue(int rowIndex, int columnIndex, int seriesIndex)
          Returns the value at the given row and column for the given series.
 Object getProperty(Object key)
          Returns the value to which the specified key is mapped, or null if this dataset does not contain the specified property.
 Collection<Object> getPropertyKeys()
          Returns a collection of all the property keys contained in this dataset.
 int getRowCount()
          Returns the number of rows in the dataset.
 MetadataModel getRowMetadata()
          Gets the row metadata for this dataset.
 Class<?> getSeriesClass(int series)
          Returns the most specific superclass for all the values in the series.
 int getSeriesCount()
          Returns the number of matrix series, which is always at least 1 (the dataset itself).
 String getSeriesName(int series)
          Returns the name for the given series.
 float getValue(int rowIndex, int columnIndex)
          Returns the value at the given row and column.
 float getValue(int rowIndex, int columnIndex, int seriesIndex)
          Returns the value at the given row and column for the given series as a float.
 void setName(String name)
          Sets the name of this dataset.
 void setProperty(Object key, Object value)
          Sets the property for the specified key.
 void setValue(int rowIndex, int columnIndex, float value)
          Sets the value at the given row and column indices.
 

Method Detail

getColumnCount

int getColumnCount()
Returns the number of columns in the dataset.

Returns:
the number of columns

getColumnMetadata

MetadataModel getColumnMetadata()
Gets the column metadata for this dataset.

Returns:
The column metadata

getName

String getName()
Returns the name of this dataset.

Returns:
The dataset name

getObjectValue

Object getObjectValue(int rowIndex,
                      int columnIndex,
                      int seriesIndex)
Returns the value at the given row and column for the given series. Series can be used to store standard error of data points for example.

Parameters:
rowIndex - the row index
columnIndex - the column index
seriesIndex - the series index
Returns:
the value
Throws:
IndexOutOfBoundsException - if rowIndex or columnIndex are out of range.

getProperty

Object getProperty(Object key)
Returns the value to which the specified key is mapped, or null if this dataset does not contain the specified property.

Parameters:
key - the key
Returns:
the value the value for the specified key

getPropertyKeys

Collection<Object> getPropertyKeys()
Returns a collection of all the property keys contained in this dataset.

Returns:
the property keys

getRowCount

int getRowCount()
Returns the number of rows in the dataset.

Returns:
the number of rows

getRowMetadata

MetadataModel getRowMetadata()
Gets the row metadata for this dataset.

Returns:
the row metadata

getSeriesClass

Class<?> getSeriesClass(int series)
Returns the most specific superclass for all the values in the series.

Parameters:
series - the index of the series
Returns:
the common ancestor class of the series values

getSeriesCount

int getSeriesCount()
Returns the number of matrix series, which is always at least 1 (the dataset itself). Series can be used to store standard error of data points for example.

Returns:
the number of series

getSeriesName

String getSeriesName(int series)
Returns the name for the given series. Series can be used to store standard error of data points for example.

Parameters:
series - the series
Returns:
the data series name
Throws:
IndexOutOfBoundsException - if series is out of range (index < 0 || index >= getSeriesCount())

getValue

float getValue(int rowIndex,
               int columnIndex)
Returns the value at the given row and column.

Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
the value.
Throws:
IndexOutOfBoundsException - if rowIndex or columnIndex are out of range.

getValue

float getValue(int rowIndex,
               int columnIndex,
               int seriesIndex)
Returns the value at the given row and column for the given series as a float. Series can be used to store standard error of data points for example.

Parameters:
rowIndex - the row index
columnIndex - the column index
seriesIndex - the series index
Returns:
the value
Throws:
IndexOutOfBoundsException - if rowIndex or columnIndex are out of range

setName

void setName(String name)
Sets the name of this dataset.

Parameters:
name - The dataset name
Throws:
UnsupportedOperationException - if the setName operation is not supported by this Dataset

setProperty

void setProperty(Object key,
                 Object value)
Sets the property for the specified key.

Parameters:
key - the key
value - the value

setValue

void setValue(int rowIndex,
              int columnIndex,
              float value)
Sets the value at the given row and column indices.

Parameters:
rowIndex - the row index
columnIndex - the column index
value - the value
Throws:
UnsupportedOperationException - if the setValue operation is not supported by this Dataset