Package fr.igred.omero.annotations
Class TableWrapper
java.lang.Object
fr.igred.omero.annotations.TableWrapper
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 Summary
ConstructorDescriptionTableWrapper
(int columnCount, String name) Constructor of the class TableWrapperTableWrapper
(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois) Constructor of the class TableWrapper.TableWrapper
(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois, String roiProperty) Constructor of the class TableWrapper.TableWrapper
(TableData table) Constructor of the class TableWrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a row to the table.void
Adds rows from an ImageJResultsTable
.void
addRows
(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois, String roiProperty) Adds rows from an ImageJResultsTable
.Creates the corresponding TableData object.int
Returns the number of columns in the table.getColumnName
(int column) Returns the name of the column.Gets theTableDataColumn
which contains information on each column of the tableClass<?>
getColumnType
(int column) Returns the type of the column.Object[][]
getData()
Gets the value contained in the tablegetData
(int x, int y) Gets a certain value of the tableReturns the fileId of the table.getId()
Returns the table ID.getName()
Returns the name of the table.int
Returns the number of rows in the table.boolean
Checks if the table is completevoid
Saves the current table as a character-delimited text file.void
Sets the information about a certain column.void
Sets the fileId of the table.void
Sets the id of the table.void
Sets the name of the table.void
setRowCount
(int rowCount) Sets the number of row in the table.toString()
Overridden to return the name of the class and the object id.void
Deletes all unused row in the table
-
Constructor Details
-
TableWrapper
Constructor of the class TableWrapper- Parameters:
columnCount
- Number of column in the table.name
- Name of the table.
-
TableWrapper
Constructor of the class TableWrapper. Uses an already existing table to create.- Parameters:
table
- The table.
-
TableWrapper
public TableWrapper(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois) throws ServiceException, AccessException, ExecutionException Constructor of the class TableWrapper. Uses an ImageJResultsTable
to create.- Parameters:
client
- The client handling the connection.results
- An ImageJ results table.imageId
- An image ID.ijRois
- A list of ImageJ Rois.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
TableWrapper
public TableWrapper(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois, String roiProperty) throws ServiceException, AccessException, ExecutionException Constructor of the class TableWrapper. Uses an ImageJResultsTable
to create.- Parameters:
client
- The client handling the connection.results
- An ImageJ results table.imageId
- An image ID.ijRois
- A list of ImageJ Rois.roiProperty
- The Roi property storing the local index/label. Defaults toROIWrapper.IJ_PROPERTY
if null or empty.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-
Method Details
-
toString
Overridden to return the name of the class and the object id. -
addRows
public void addRows(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois) throws ServiceException, AccessException, ExecutionException Adds rows from an ImageJResultsTable
.- Parameters:
client
- The client handling the connection.results
- An ImageJ results table.imageId
- An image ID.ijRois
- A list of ImageJ Rois.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addRows
public void addRows(Client client, ResultsTable results, Long imageId, List<? extends Roi> ijRois, String roiProperty) throws ServiceException, AccessException, ExecutionException Adds rows from an ImageJResultsTable
.- Parameters:
client
- The client handling the connection.results
- An ImageJ results table.imageId
- An image ID.ijRois
- A list of ImageJ Rois.roiProperty
- The Roi property storing the local ROI index/label. Defaults toROIWrapper.IJ_PROPERTY
if null or empty.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getColumns
Gets theTableDataColumn
which contains information on each column of the table- Returns:
- the
TableDataColumn
which contains information on each column of the table.
-
getData
Gets the value contained in the table- Returns:
- the value contained in the table.
-
getData
Gets a certain value of the table- Parameters:
x
- Row position.y
- Column position.- Returns:
- the value at position data[y][x].
-
getFileId
Returns the fileId of the table.- Returns:
- See above.
-
setFileId
Sets the fileId of the table.- Parameters:
fileId
- New fileId.
-
getId
Returns the table ID.- Returns:
- See above.
-
setId
Sets the id of the table.- Parameters:
id
- New id.
-
getName
Returns the name of the table.- Returns:
- See above.
-
setName
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
Returns the name of the column.- Parameters:
column
- Column number.- Returns:
- See above.
-
getColumnType
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
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.
-
addRow
Adds a row to the table.- Parameters:
os
- Value for each column for the row.- Throws:
IndexOutOfBoundsException
- Table is not initialized or already full.IllegalArgumentException
- Incorrect argument number.
-
truncateRow
public void truncateRow()Deletes all unused row in the table -
createTable
Creates the corresponding TableData object.- Returns:
- See above.
-
saveAs
public void saveAs(String path, char delimiter) throws FileNotFoundException, UnsupportedEncodingException Saves the current table as a character-delimited text file.- Parameters:
path
- The path to the file where the table will be saved.delimiter
- The character used to specify the boundary between columns.- Throws:
FileNotFoundException
- The requested file cannot be written.UnsupportedEncodingException
- If the UTF8 charset is not supported.
-