Interface DataTable
- All Known Implementing Classes:
ColumnTable
A non FITS-specific interface for generic table data access. For a
FITS-specific interface see TableData
.
Note, that this interface is the little brother to
TableData
, with nearly identical method signatures. But,
there are differences too, such as the type of argument of setting row data,
and when and what excpetions are thrown. The other one also defines some
further methods. Overall it would have been a more prudent design to
consolidate the two interfaces but this is what we have so we stick to it.
However, mabe this is something an upcoming major release may address...
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetColumn
(int column) Returns the data for a particular column in as an array of elements.getElement
(int row, int col) Returns the data element in this tableint
getNCols()
Returns the number of columns contained in this table.int
getNRows()
Returns the number of rows contained in this table.getRow
(int row) Indexed access to data by rowvoid
Sets new data for a table column.void
setElement
(int row, int col, Object newElement) Sets new data element in this tablevoid
Sets new data for a table row
-
Method Details
-
getColumn
Returns the data for a particular column in as an array of elements. See
TableData.addColumn(Object)
for more information about the format of data elements in general.- Parameters:
column
- The 0-based column index.- Returns:
- an array of primitives (for scalar columns), or else an
Object[]
array, or possiblynull
- See Also:
-
getElement
Returns the data element in this table- Parameters:
row
- the row index of the elementcol
- the column index of the element- Returns:
- the object to store at the specified row, col in the table.
- See Also:
-
getNCols
int getNCols()Returns the number of columns contained in this table.- Returns:
- the current number of columns in the table.
- See Also:
-
getNRows
int getNRows()Returns the number of rows contained in this table.- Returns:
- the current number of rows in the table.
- See Also:
-
getRow
Indexed access to data by row- Parameters:
row
- the row index- Returns:
- an object containing the row data (for all column) of the
specified row, or possubly
null
. - See Also:
-
setColumn
Sets new data for a table column. SeeTableData.addColumn(Object)
for more information about the expected column data format.- Parameters:
column
- the column indexnewColumn
- an object containing the new column data (for all rows) of the specified column.- Throws:
TableException
- if the table could not be modified- See Also:
-
setElement
Sets new data element in this table- Parameters:
row
- the row index of the elementcol
- the column index of the elementnewElement
- the object to store at the specified row, col in the table.- Throws:
TableException
- if the table could not be modified- See Also:
-
setRow
Sets new data for a table row- Parameters:
row
- the column indexnewRow
- an object containing the new row data (for all columns) of the specified row.- Throws:
TableException
- if the table could not be modified- See Also:
-