public class TableWrapper extends Object implements Table
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 and Description |
---|
TableWrapper(Client client,
ij.measure.ResultsTable results,
Long imageId,
Collection<? extends Roi> ijRois)
Constructor of the class TableWrapper.
|
TableWrapper(Client client,
ij.measure.ResultsTable results,
Long imageId,
Collection<? extends Roi> ijRois,
String roiProperty)
Constructor of the class TableWrapper.
|
TableWrapper(int columnCount,
String name)
Constructor of the class TableWrapper
|
TableWrapper(TableData table)
Constructor of the class TableWrapper.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow(Object... os)
Adds a row to the table.
|
void |
addRows(Client client,
ij.measure.ResultsTable results,
Long imageId,
Collection<? extends Roi> ijRois,
String roiProperty)
Adds rows from an ImageJ
ResultsTable . |
TableData |
createTable()
Creates the corresponding TableData object.
|
int |
getColumnCount()
Returns the number of columns in the table.
|
String |
getColumnName(int column)
Returns the name of the column.
|
TableDataColumn[] |
getColumns()
Gets the
TableDataColumn which contains information on each column of the table |
Class<?> |
getColumnType(int column)
Returns the type of the column.
|
Object[][] |
getData()
Gets the value contained in the table
|
Object |
getData(int x,
int y)
Gets a certain value of the table
|
Long |
getFileId()
Returns the fileId of the table.
|
Long |
getId()
Returns the table ID.
|
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 complete
|
void |
saveAs(String path,
char delimiter)
Saves the current table as a character-delimited text file.
|
void |
setColumn(int column,
String columnName,
Class<?> type)
Sets the information about a certain column.
|
void |
setFileId(Long fileId)
Sets the fileId of the table.
|
void |
setId(Long id)
Sets the ID of the table.
|
void |
setName(String name)
Sets the name of the table.
|
void |
setRowCount(int rowCount)
Sets the number of row in the table.
|
String |
toString()
Overridden to return the name of the class and the object id.
|
void |
truncateRow()
Deletes all unused row in the table
|
public TableWrapper(int columnCount, String name)
columnCount
- Number of column in the table.name
- Name of the table.public TableWrapper(TableData table)
table
- The table.public TableWrapper(Client client, ij.measure.ResultsTable results, Long imageId, Collection<? extends Roi> ijRois) throws ServiceException, AccessException, ExecutionException
ResultsTable
to create.client
- The client handling the connection.results
- An ImageJ results table.imageId
- An image ID.ijRois
- A list of ImageJ Rois.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public TableWrapper(Client client, ij.measure.ResultsTable results, Long imageId, Collection<? extends Roi> ijRois, String roiProperty) throws ServiceException, AccessException, ExecutionException
ResultsTable
to create.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 to ROI.IJ_PROPERTY
if
null or empty.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public String toString()
public void addRows(Client client, ij.measure.ResultsTable results, Long imageId, Collection<? extends Roi> ijRois, String roiProperty) throws ServiceException, AccessException, ExecutionException
ResultsTable
.addRows
in interface Table
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 to ROI.IJ_PROPERTY
if null or empty.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public TableDataColumn[] getColumns()
TableDataColumn
which contains information on each column of the tablegetColumns
in interface Table
TableDataColumn
which contains information on each column of the table.public Object[][] getData()
public Object getData(int x, int y)
public Long getFileId()
public void setFileId(Long fileId)
public Long getId()
public void setId(Long id)
public String getName()
public void setName(String name)
public int getColumnCount()
getColumnCount
in interface Table
public String getColumnName(int column)
getColumnName
in interface Table
column
- Column number.public Class<?> getColumnType(int column)
getColumnType
in interface Table
column
- Column number.public int getRowCount()
getRowCount
in interface Table
public void setRowCount(int rowCount)
setRowCount
in interface Table
rowCount
- New rowCount.public boolean isComplete()
isComplete
in interface Table
public void setColumn(int column, String columnName, Class<?> type)
setColumn
in interface Table
column
- Column number.columnName
- Name of the column.type
- Type of the column.IndexOutOfBoundsException
- Column number is bigger than actual number of column in the table.public void addRow(Object... os)
addRow
in interface Table
os
- Value for each column for the row.IndexOutOfBoundsException
- Table is not initialized or already full.IllegalArgumentException
- Incorrect argument number.public void truncateRow()
truncateRow
in interface Table
public TableData createTable()
createTable
in interface Table
public void saveAs(String path, char delimiter) throws FileNotFoundException, UnsupportedEncodingException
saveAs
in interface Table
path
- The path to the file where the table will be saved.delimiter
- The character used to specify the boundary between columns.FileNotFoundException
- The requested file cannot be written.UnsupportedEncodingException
- If the UTF8 charset is not supported.Copyright © 2020–2023 GReD. All rights reserved.