Class TableWrapper


  • public class TableWrapper
    extends Object
    Class containing the information to create a Table in OMERO.

    The TableData itself is not contained, only the elements to create it, because once created the TableData cannot be altered.

    To get the TableData corresponding to the elements contained use createTable.

    • Constructor Detail

      • TableWrapper

        public TableWrapper​(int columnCount,
                            String name)
        Constructor of the class TableWrapper
        Parameters:
        columnCount - Number of column in the table.
        name - Name of the table.
      • TableWrapper

        public TableWrapper​(TableData table)
        Constructor of the class TableWrapper. Uses an already existing table to create.
        Parameters:
        table - The table.
    • Method Detail

      • toString

        public String toString()
        Overridden to return the name of the class and the object id.
        Overrides:
        toString in class Object
      • getData

        public Object[][] getData()
        Gets the value contained in the table
        Returns:
        the value contained in the table.
      • getData

        public Object getData​(int x,
                              int y)
        Gets a certain value of the table
        Parameters:
        x - Row position.
        y - Column position.
        Returns:
        the value at position data[y][x].
      • getFileId

        public Long getFileId()
        Returns the fileId of the table.
        Returns:
        See above.
      • setFileId

        public void setFileId​(Long fileId)
        Sets the fileId of the table.
        Parameters:
        fileId - New fileId.
      • getId

        public Long getId()
        Returns the table ID.
        Returns:
        See above.
      • setId

        public void setId​(Long id)
        Sets the id of the table.
        Parameters:
        id - New id.
      • getName

        public String getName()
        Returns the name of the table.
        Returns:
        See above.
      • setName

        public void setName​(String name)
        Sets the name of the table.
        Parameters:
        name - New name.
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the table.
        Returns:
        See above.
      • getColumnName

        public String getColumnName​(int column)
        Returns the name of the column.
        Parameters:
        column - Column number.
        Returns:
        See above.
      • getColumnType

        public Class<?> getColumnType​(int column)
        Returns the type of the column.
        Parameters:
        column - Column number.
        Returns:
        See above.
      • getRowCount

        public int getRowCount()
        Returns the number of rows in the table.
        Returns:
        See above.
      • setRowCount

        public void setRowCount​(int rowCount)
        Sets the number of row in the table. Copies already existing data if some were already in the data
        Parameters:
        rowCount - New rowCount.
      • isComplete

        public boolean isComplete()
        Checks if the table is complete
        Returns:
        true if the table is completed, false if some rows are still empty.
      • setColumn

        public void setColumn​(int column,
                              String columnName,
                              Class<?> type)
        Sets the information about a certain column.
        Parameters:
        column - Column number.
        columnName - Name of the column.
        type - Type of the column.
        Throws:
        IndexOutOfBoundsException - Column number is bigger than actual number of column in the table.
      • truncateRow

        public void truncateRow()
        Deletes all unused row in the table
      • createTable

        public TableData createTable()
        Creates the corresponding TableData object.
        Returns:
        See above.