org.broadinstitute.genee.matrix
Class AbstractDataset

java.lang.Object
  extended by org.broadinstitute.genee.matrix.AbstractDataset
All Implemented Interfaces:
Dataset
Direct Known Subclasses:
FixedSizeAbstractDataset

public abstract class AbstractDataset
extends Object
implements Dataset

Abstract dataset.


Constructor Summary
AbstractDataset()
           
 
Method Summary
 int addSeries(String name, Class<?> c)
           
 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.
 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, int seriesIndex)
          Returns the value at the given row and column for the given series as a float.
 void removeSeries(int index)
           
 void setName(String name)
          Sets the name of this dataset.
 void setObjectValue(int rowIndex, int columnIndex, Object value, int seriesIndex)
          Sets the value at the given row and column.
 void setProperty(Object key, Object value)
          Sets the property for the specified key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.broadinstitute.genee.matrix.Dataset
getColumnCount, getColumnMetadata, getRowCount, getRowMetadata, getValue, setValue
 

Constructor Detail

AbstractDataset

public AbstractDataset()
Method Detail

addSeries

public int addSeries(String name,
                     Class<?> c)

getName

public final String getName()
Description copied from interface: Dataset
Returns the name of this dataset.

Specified by:
getName in interface Dataset
Returns:
The dataset name

getObjectValue

public Object getObjectValue(int rowIndex,
                             int columnIndex,
                             int seriesIndex)
Description copied from interface: Dataset
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.

Specified by:
getObjectValue in interface Dataset
Parameters:
rowIndex - the row index
columnIndex - the column index
seriesIndex - the series index
Returns:
the value

getProperty

public Object getProperty(Object key)
Description copied from interface: Dataset
Returns the value to which the specified key is mapped, or null if this dataset does not contain the specified property.

Specified by:
getProperty in interface Dataset
Parameters:
key - the key
Returns:
the value the value for the specified key

getPropertyKeys

public Collection<Object> getPropertyKeys()
Description copied from interface: Dataset
Returns a collection of all the property keys contained in this dataset.

Specified by:
getPropertyKeys in interface Dataset
Returns:
the property keys

getSeriesClass

public Class<?> getSeriesClass(int series)
Description copied from interface: Dataset
Returns the most specific superclass for all the values in the series.

Specified by:
getSeriesClass in interface Dataset
Parameters:
series - the index of the series
Returns:
the common ancestor class of the series values

getSeriesCount

public int getSeriesCount()
Description copied from interface: Dataset
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.

Specified by:
getSeriesCount in interface Dataset
Returns:
the number of series

getSeriesName

public String getSeriesName(int series)
Description copied from interface: Dataset
Returns the name for the given series. Series can be used to store standard error of data points for example.

Specified by:
getSeriesName in interface Dataset
Parameters:
series - the series
Returns:
the data series name

getValue

public float getValue(int rowIndex,
                      int columnIndex,
                      int seriesIndex)
Description copied from interface: Dataset
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.

Specified by:
getValue in interface Dataset
Parameters:
rowIndex - the row index
columnIndex - the column index
seriesIndex - the series index
Returns:
the value

removeSeries

public void removeSeries(int index)

setName

public void setName(String name)
Description copied from interface: Dataset
Sets the name of this dataset.

Specified by:
setName in interface Dataset
Parameters:
name - The dataset name

setObjectValue

public void setObjectValue(int rowIndex,
                           int columnIndex,
                           Object value,
                           int seriesIndex)
Sets the value at the given row and column.

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

setProperty

public void setProperty(Object key,
                        Object value)
Description copied from interface: Dataset
Sets the property for the specified key.

Specified by:
setProperty in interface Dataset
Parameters:
key - the key
value - the value