Class DefaultAnonymousTable

    • Constructor Detail

      • DefaultAnonymousTable

        public DefaultAnonymousTable​(@Nonnull
                                     java.lang.Object[][] data)
        Create a new anonymous table with an existing array of cells. Row 0 has the column names and column 0 has the row names.
        Parameters:
        data - the data in the table. Note that this data is not copied to an new array but used by the table as is.
    • Method Detail

      • storeTableAsCSV

        public void storeTableAsCSV​(@Nonnull
                                    java.io.File file)
                             throws java.io.FileNotFoundException
        Store the table to a CSV file.
        Specified by:
        storeTableAsCSV in interface Table
        Parameters:
        file - the CSV file
        Throws:
        java.io.FileNotFoundException - if file not found
      • storeTableAsCSV

        public void storeTableAsCSV​(@Nonnull
                                    java.io.File file,
                                    @CheckForNull
                                    java.lang.String systemName,
                                    @CheckForNull
                                    java.lang.String userName)
                             throws java.io.FileNotFoundException
        Store the table to a CSV file. If system name and/or user name is not null, these values are used instead of the tables own system name and user name. If no system name and user name is given and the table is anonymous, no system name and user name is stored in the file.
        Specified by:
        storeTableAsCSV in interface Table
        Parameters:
        file - the CSV file
        systemName - the system name of the table
        userName - the user name of the table
        Throws:
        java.io.FileNotFoundException - if file not found
      • getCell

        public java.lang.Object getCell​(int row,
                                        int column)
        Get the value of a cell.
        Specified by:
        getCell in interface Table
        Parameters:
        row - the row of the cell
        column - the column of the cell
        Returns:
        the value of the cell
      • setCell

        public void setCell​(java.lang.Object value,
                            int row,
                            int column)
        Get the value of a cell.
        Specified by:
        setCell in interface Table
        Parameters:
        value - the new value of the cell
        row - the row of the cell
        column - the column of the cell
      • numRows

        public int numRows()
        Get the number of rows in the table.
        Specified by:
        numRows in interface Table
        Returns:
        the number of rows
      • numColumns

        public int numColumns()
        Get the number of columns in the table.
        Specified by:
        numColumns in interface Table
        Returns:
        the number of columns
      • getRowNumber

        public int getRowNumber​(java.lang.String rowName)
        Get the row number by name of row.
        Specified by:
        getRowNumber in interface Table
        Parameters:
        rowName - the name of the row. If there is no row with this name, and rowName is a positive integer, that row number will be returned.
        Returns:
        the row number
      • getColumnNumber

        public int getColumnNumber​(java.lang.String columnName)
        Get the row number by name of row.
        Specified by:
        getColumnNumber in interface Table
        Parameters:
        columnName - the name of the column. If there is no column with this name, and columnName is a positive integer, that column number will be returned.
        Returns:
        the column number