Package fr.igred.omero.annotations
Class TableWrapper
- java.lang.Object
-
- fr.igred.omero.annotations.TableWrapper
-
- All Implemented Interfaces:
Table
public class TableWrapper extends java.lang.Object implements Table
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
Constructors Constructor Description TableWrapper(int columnCount, java.lang.String name)
Constructor of the class TableWrapperTableWrapper(Client client, ResultsTable results, java.lang.Long imageId, java.util.Collection<? extends Roi> ijRois)
Constructor of the class TableWrapper.TableWrapper(Client client, ResultsTable results, java.lang.Long imageId, java.util.Collection<? extends Roi> ijRois, java.lang.String roiProperty)
Constructor of the class TableWrapper.TableWrapper(TableData table)
Constructor of the class TableWrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRow(java.lang.Object... os)
Adds a row to the table.void
addRows(Client client, ResultsTable results, java.lang.Long imageId, java.util.Collection<? extends Roi> ijRois, java.lang.String roiProperty)
Adds rows from an ImageJResultsTable
.TableData
createTable()
Creates the corresponding TableData object.int
getColumnCount()
Returns the number of columns in the table.java.lang.String
getColumnName(int column)
Returns the name of the column.TableDataColumn[]
getColumns()
Gets theTableDataColumn
which contains information on each column of the tablejava.lang.Class<?>
getColumnType(int column)
Returns the type of the column.java.lang.Object[][]
getData()
Gets the value contained in the tablejava.lang.Object
getData(int x, int y)
Gets a certain value of the tablejava.lang.Long
getFileId()
Returns the fileId of the table.java.lang.Long
getId()
Returns the table ID.java.lang.String
getName()
Returns the name of the table.int
getRowCount()
Returns the number of rows in the table.boolean
isComplete()
Checks if the table is completevoid
saveAs(java.lang.String path, char delimiter)
Saves the current table as a character-delimited text file.void
setColumn(int column, java.lang.String columnName, java.lang.Class<?> type)
Sets the information about a certain column.void
setFileId(java.lang.Long fileId)
Sets the fileId of the table.void
setId(java.lang.Long id)
Sets the ID of the table.void
setName(java.lang.String name)
Sets the name of the table.void
setRowCount(int rowCount)
Sets the number of row in the table.java.lang.String
toString()
Overridden to return the name of the class and the object id.void
truncateRow()
Deletes all unused row in the table
-
-
-
Constructor Detail
-
TableWrapper
public TableWrapper(int columnCount, java.lang.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.
-
TableWrapper
public TableWrapper(Client client, ResultsTable results, java.lang.Long imageId, java.util.Collection<? extends Roi> ijRois) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
TableWrapper
public TableWrapper(Client client, ResultsTable results, java.lang.Long imageId, java.util.Collection<? extends Roi> ijRois, java.lang.String roiProperty) throws ServiceException, AccessException, java.util.concurrent.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 toROI.IJ_PROPERTY
if null or empty.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-
Method Detail
-
toString
public java.lang.String toString()
Overridden to return the name of the class and the object id.- Overrides:
toString
in classjava.lang.Object
-
addRows
public void addRows(Client client, ResultsTable results, java.lang.Long imageId, java.util.Collection<? extends Roi> ijRois, java.lang.String roiProperty) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Adds rows from an ImageJResultsTable
.- Specified by:
addRows
in interfaceTable
- 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 toROI.IJ_PROPERTY
if null or empty.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getColumns
public TableDataColumn[] getColumns()
Gets theTableDataColumn
which contains information on each column of the table- Specified by:
getColumns
in interfaceTable
- Returns:
- the
TableDataColumn
which contains information on each column of the table.
-
getData
public java.lang.Object[][] getData()
Gets the value contained in the table
-
getData
public java.lang.Object getData(int x, int y)
Gets a certain value of the table
-
getFileId
public java.lang.Long getFileId()
Returns the fileId of the table.
-
setFileId
public void setFileId(java.lang.Long fileId)
Sets the fileId of the table.
-
getId
public java.lang.Long getId()
Returns the table ID.
-
setId
public void setId(java.lang.Long id)
Sets the ID of the table.
-
getName
public java.lang.String getName()
Returns the name of the table.
-
setName
public void setName(java.lang.String name)
Sets the name of the table.
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table.- Specified by:
getColumnCount
in interfaceTable
- Returns:
- See above.
-
getColumnName
public java.lang.String getColumnName(int column)
Returns the name of the column.- Specified by:
getColumnName
in interfaceTable
- Parameters:
column
- Column number.- Returns:
- See above.
-
getColumnType
public java.lang.Class<?> getColumnType(int column)
Returns the type of the column.- Specified by:
getColumnType
in interfaceTable
- Parameters:
column
- Column number.- Returns:
- See above.
-
getRowCount
public int getRowCount()
Returns the number of rows in the table.- Specified by:
getRowCount
in interfaceTable
- 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- Specified by:
setRowCount
in interfaceTable
- Parameters:
rowCount
- New rowCount.
-
isComplete
public boolean isComplete()
Checks if the table is complete- Specified by:
isComplete
in interfaceTable
- Returns:
- true if the table is completed, false if some rows are still empty.
-
setColumn
public void setColumn(int column, java.lang.String columnName, java.lang.Class<?> type)
Sets the information about a certain column.
-
addRow
public void addRow(java.lang.Object... os)
Adds a row to the table.
-
truncateRow
public void truncateRow()
Deletes all unused row in the table- Specified by:
truncateRow
in interfaceTable
-
createTable
public TableData createTable()
Creates the corresponding TableData object.- Specified by:
createTable
in interfaceTable
- Returns:
- See above.
-
saveAs
public void saveAs(java.lang.String path, char delimiter) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
Saves the current table as a character-delimited text file.- Specified by:
saveAs
in interfaceTable
- Parameters:
path
- The path to the file where the table will be saved.delimiter
- The character used to specify the boundary between columns.- Throws:
java.io.FileNotFoundException
- The requested file cannot be written.java.io.UnsupportedEncodingException
- If the UTF8 charset is not supported.
-
-