Interface StarTable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object getCell​(long irow, int icol)
      Returns the contents of a given table cell.
      java.util.List getColumnAuxDataInfos()
      Returns an ordered list of ValueInfo objects representing the auxiliary metadata returned by getColumnInfo(int).getAuxData() calls.
      int getColumnCount()
      Returns the number of columns in this table.
      ColumnInfo getColumnInfo​(int icol)
      Returns the object describing the data in a given column.
      java.lang.String getName()
      Returns the name of this table, if it has one.
      DescribedValue getParameterByName​(java.lang.String parname)
      Returns a parameter (table-wide metadata item) of this table located by its name.
      java.util.List getParameters()
      Returns a list of table parameters, that is items which pertain to the entire table.
      java.lang.Object[] getRow​(long irow)
      Returns the contents of a given table row.
      long getRowCount()
      Returns the number of rows in this table, if known.
      RowSequence getRowSequence()
      Returns an object which can iterate over all the rows in the table sequentially.
      java.net.URL getURL()
      Returns the URL of this table, if it has one.
      boolean isRandom()
      Indicates whether random access is provided by this table.
      void setName​(java.lang.String name)
      Sets the name of this table.
      void setParameter​(DescribedValue dval)
      Adds the given DescribedValue to the list of parameter metadata objects associated with this table.
      void setURL​(java.net.URL url)
      Sets the URL of this table.
    • Method Detail

      • getColumnCount

        int getColumnCount()
        Returns the number of columns in this table.
        Returns:
        the number of columns
      • getRowCount

        long getRowCount()
        Returns the number of rows in this table, if known. If the number of rows cannot be (easily) determined, a value of -1 will be returned.
        Returns:
        the number of rows, or -1
      • getURL

        java.net.URL getURL()
        Returns the URL of this table, if it has one. A non-null return from this method indicates that this table is in some sense persistent.
        Returns:
        the URL of this table, or null if none is known
      • setURL

        void setURL​(java.net.URL url)
        Sets the URL of this table. It ought to be possible in principle to reconstruct this table by reading the resource at url. If called, the supplied url should provide the return value for subsequent calls of getURL().
        Parameters:
        url - table URL
      • getName

        java.lang.String getName()
        Returns the name of this table, if it has one. The meaning of the name is not defined, but it will typically be a short string of text indicating the identity of this table.
        Returns:
        a name for this table, or null if no suitable one exists
      • setName

        void setName​(java.lang.String name)
        Sets the name of this table. If called, the supplied name should provide the return value for subsequent calls of getName().
        Parameters:
        name - table name
      • getParameters

        java.util.List getParameters()
        Returns a list of table parameters, that is items which pertain to the entire table. Each element of this list must be a DescribedValue object.
        Returns:
        a List of DescribedValue objects constituting table-wide metadata not covered elsewhere in this interface
      • getParameterByName

        DescribedValue getParameterByName​(java.lang.String parname)
        Returns a parameter (table-wide metadata item) of this table located by its name. If more than one parameter with the given name exists, an arbitrary one will be returned. If no parameter with the given name exists, null will be returned.
        Parameters:
        parname - the name of the table parameter required
      • setParameter

        void setParameter​(DescribedValue dval)
        Adds the given DescribedValue to the list of parameter metadata objects associated with this table. If an item in the parameter list with the same name as the supplied value already exists, it is removed from the list.
        Parameters:
        dval - the new parameter datum to add
      • getColumnInfo

        ColumnInfo getColumnInfo​(int icol)
        Returns the object describing the data in a given column.
        Parameters:
        icol - the column for which header information is required
        Returns:
        a ValueInfo object for column icol
      • getColumnAuxDataInfos

        java.util.List getColumnAuxDataInfos()
        Returns an ordered list of ValueInfo objects representing the auxiliary metadata returned by getColumnInfo(int).getAuxData() calls. The idea is that the resulting list can be used to find out the kind of per-column metadata which can be expected to be found in some or all columns of this table. Each item in the returned list should have a unique name, and other characteristics which are applicable to auxData items which may be returned from any of the columns in this table.

        The order of the list may indicate some sort of natural ordering of these keys. The returned list is not guaranteed to be complete; it is legal to return an empty list if nothing is known about auxiliary metadata. The list ought not to contain duplicate elements.

        Returns:
        an unmodifiable ordered set of known metadata keys
        See Also:
        ColumnInfo.getAuxData()
      • getRowSequence

        RowSequence getRowSequence()
                            throws java.io.IOException
        Returns an object which can iterate over all the rows in the table sequentially.
        Returns:
        an object providing sequential access to the table data
        Throws:
        java.io.IOException - if there is an error providing access
      • isRandom

        boolean isRandom()
        Indicates whether random access is provided by this table. Only if the result is true may the getRow(long) and getCell(long, int) methods be used.
        Returns:
        true if table random access methods are available
      • getCell

        java.lang.Object getCell​(long irow,
                                 int icol)
                          throws java.io.IOException
        Returns the contents of a given table cell. The class of the returned object should be the same as, or a subclass of, the class returned by getColumnInfo(icol).getContentClass().
        Parameters:
        irow - the index of the cell's row
        icol - the index of the cell's column
        Returns:
        the contents of this cell
        Throws:
        java.io.IOException - if there is an error reading the data
        java.lang.UnsupportedOperationException - if isRandom returns false
      • getRow

        java.lang.Object[] getRow​(long irow)
                           throws java.io.IOException
        Returns the contents of a given table row. The returned value is equivalent to an array formed of all the objects returned by getCell(irow,icol) for all the columns icol in sequence.
        Parameters:
        irow - the index of the row to retrieve
        Returns:
        an array of the objects in each cell in row irow
        Throws:
        java.io.IOException - if there is an error reading the data
        java.lang.UnsupportedOperationException - if isRandom returns false