Class TableData


  • public abstract class TableData
    extends java.lang.Object
    Contains the data from a table in easy to digest form (no IOExceptions). Suitable for holding small tables.
    Since:
    9 Oct 2018
    Author:
    Mark Taylor
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static TableData createTableData​(Reporter reporter, uk.ac.starlink.table.StarTable table)
      Adapts a StarTable to a TableData.
      abstract java.lang.Object getCell​(int irow, int icol)
      Returns the value of a cell.
      java.lang.Object[] getColumn​(int icol)
      Returns the content of one column of the table as an array.
      abstract int getRowCount()
      Returns number of rows.
      uk.ac.starlink.table.StarTable getTable()
      Returns the table on which this object is based.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRowCount

        public abstract int getRowCount()
        Returns number of rows.
        Returns:
        row count, >=0
      • getCell

        public abstract java.lang.Object getCell​(int irow,
                                                 int icol)
        Returns the value of a cell.
        Parameters:
        irow - row index
        icol - column index
      • getColumn

        public java.lang.Object[] getColumn​(int icol)
        Returns the content of one column of the table as an array.
        Parameters:
        icol - column index
        Returns:
        array with one element per table row
      • getTable

        public uk.ac.starlink.table.StarTable getTable()
        Returns the table on which this object is based.
        Returns:
        table
      • createTableData

        public static TableData createTableData​(Reporter reporter,
                                                uk.ac.starlink.table.StarTable table)
        Adapts a StarTable to a TableData. In case of trouble, null is returned and messages are reported as appropriate.
        Parameters:
        reporter - reporter
        table - input table
        Returns:
        table data