Class AbstractArrayStatistic.StatisticContainer<T extends Serializable>

    • Field Detail

      • m_Header

        protected String[] m_Header
        for the header row.
      • m_Data

        protected Object[][] m_Data
        for the actual data.
      • m_MetaData

        protected Map<String,​Object> m_MetaData
        for storing additional information.
    • Constructor Detail

      • StatisticContainer

        public StatisticContainer​(int rows,
                                  int cols)
        Initializes the container with the specified (data) dimensions.
        Parameters:
        rows - the number of rows
        cols - the number of cols
    • 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 for
        value - 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 cell
        col - the column of the cell
        value - 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 cell
        col - 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 value
        value - 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
      • toString

        public String toString()
        Returns the stored data in CSV format.
        Overrides:
        toString in class Object
        Returns:
        the data as CSV string