Package fr.igred.omero.annotations
Class TableWrapper
- java.lang.Object
-
- fr.igred.omero.annotations.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 Summary
Constructors Constructor Description TableWrapper(int columnCount, String name)
Constructor of the class TableWrapperTableWrapper(Client client, ResultsTable results, Long imageId, List<Roi> ijRois, String roiIdProperty)
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(Object... os)
Adds a row to the table.void
addRows(Client client, ResultsTable results, Long imageId, List<Roi> ijRois, String roiIdProperty)
Adds rows from an ImageJResultsTable
.TableData
createTable()
int
getColumnCount()
String
getColumnName(int column)
TableDataColumn[]
getColumns()
Gets theTableDataColumn
which contains information on each column of the tableClass<?>
getColumnType(int column)
Object[][]
getData()
Gets the value contained in the tableObject
getData(int x, int y)
Gets a certain value of the tableLong
getFileId()
Long
getId()
String
getName()
int
getRowCount()
boolean
isComplete()
Checks if the table is completevoid
setColumn(int column, String name, 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.void
truncateRow()
Deletes all unused row in the table
-
-
-
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.
-
TableWrapper
public TableWrapper(Client client, ResultsTable results, Long imageId, List<Roi> ijRois, String roiIdProperty) 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.roiIdProperty
- The Roi property storing the ROI IDs.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-
Method Detail
-
addRows
public void addRows(Client client, ResultsTable results, Long imageId, List<Roi> ijRois, String roiIdProperty) 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.roiIdProperty
- The Roi property storing the ROI IDs.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getColumns
public TableDataColumn[] 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
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:
- fileId of the table.
-
setFileId
public void setFileId(Long fileId)
Sets the fileId of the table.- Parameters:
fileId
- New fileId.
-
getId
public Long getId()
- Returns:
- id of the table.
-
setId
public void setId(Long id)
Sets the id of the table.- Parameters:
id
- New id.
-
getName
public String getName()
- Returns:
- name of the table.
-
setName
public void setName(String name)
Sets the name of the table.- Parameters:
name
- New name.
-
getColumnCount
public int getColumnCount()
- Returns:
- number of column in the table.
-
getColumnName
public String getColumnName(int column)
- Parameters:
column
- Column number.- Returns:
- The name of the column.
-
getColumnType
public Class<?> getColumnType(int column)
- Parameters:
column
- Column number.- Returns:
- The type of the column.
-
getRowCount
public int getRowCount()
- Returns:
- number of row in the table.
-
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 row are still empty.
-
setColumn
public void setColumn(int column, String name, Class<?> type) throws IndexOutOfBoundsException
Sets the information about a certain column.- Parameters:
column
- Column number.name
- Name of the column.type
- Type of the column.- Throws:
IndexOutOfBoundsException
- Column number is bigger than actual number of column in the table.
-
addRow
public void addRow(Object... os) throws IndexOutOfBoundsException, IllegalArgumentException
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
public TableData createTable()
-
-