Package adams.data.statistics
Class AbstractArrayStatistic.StatisticContainer<T extends Serializable>
- java.lang.Object
-
- adams.data.statistics.AbstractArrayStatistic.StatisticContainer<T>
-
- Type Parameters:
T- the type of element in the arrays
- All Implemented Interfaces:
Serializable
- Enclosing class:
- AbstractArrayStatistic<T extends Serializable>
public static class AbstractArrayStatistic.StatisticContainer<T extends Serializable> extends Object implements Serializable
The container for the generated statistic result.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatisticContainer(int rows, int cols)Initializes the container with the specified (data) dimensions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the header and the data, as well as the meta-data.TgetCell(int row, int col)Returns the value of the specified cell.intgetColumnCount()Returns the number of columns.StringgetHeader(int col)Returns the value of the header at the specified column.ObjectgetMetaData(String key)Returns the meta-data value associated with the specified key.intgetRowCount()Returns the number of (data) rows.booleanhasMetaData(String key)Returns whether meta-data is associated with the specified key.Set<String>keysMetaData()Returns all the keys of the stored meta-data.voidsetCell(int row, int col, T value)Sets the value of the specified cell.voidsetHeader(int col, String value)Sets the header for the given column.voidsetMetaData(String key, Object value)Sets the meta-data to store.SpreadSheettoSpreadSheet()Generates a SpreadSheet object from the stored data.StringtoString()Returns the stored data in CSV format.
-
-
-
Method Detail
-
clear
public void clear()
Clears the header and the data, as well as the meta-data.
-
getColumnCount
public int getColumnCount()
Returns the number of columns.- Returns:
- the number of columns
-
getRowCount
public int getRowCount()
Returns the number of (data) rows.- Returns:
- the number of (data) rows
-
setHeader
public void setHeader(int col, String value)Sets the header for the given column.- Parameters:
col- the column to set the header forvalue- the value for the header
-
getHeader
public String getHeader(int col)
Returns the value of the header at the specified column.- Parameters:
col- the column to get the header for- Returns:
- the header string
-
setCell
public void setCell(int row, int col, T value)Sets the value of the specified cell.- Parameters:
row- the row of the cellcol- the column of the cellvalue- the new value for the cell
-
getCell
public T getCell(int row, int col)
Returns the value of the specified cell.- Parameters:
row- the row of the cellcol- the column of the cell- Returns:
- the stored value, can be null
-
setMetaData
public void setMetaData(String key, Object value)
Sets the meta-data to store.- Parameters:
key- the key for the valuevalue- the value to store
-
hasMetaData
public boolean hasMetaData(String key)
Returns whether meta-data is associated with the specified key.- Parameters:
key- the key of the value to look for- Returns:
- true if meta-data available
-
getMetaData
public Object getMetaData(String key)
Returns the meta-data value associated with the specified key.- Parameters:
key- the key of the value to retrieve- Returns:
- the associated value, null if not found
-
keysMetaData
public Set<String> keysMetaData()
Returns all the keys of the stored meta-data.- Returns:
- the keys
-
toSpreadSheet
public SpreadSheet toSpreadSheet()
Generates a SpreadSheet object from the stored data.- Returns:
- the generated spreadsheet
-
-