public interface TabularData extends Closeable
The cell data may always be retrieved sequentially from the table
by acquiring a RowSequence
object
(method getRowSequence()
) -
this allows you to read all the data from the first row to the last.
Multiple RowSequences
may be simultaneously active.
In some cases random access may also be available; if isRandom()
returns true, then the getRowAccess()
, getRow(long)
and
getCell(long, int)
methods can be used to retrieve cell values in any order.
The objects retrieved from cells in a given column are of course
determined by the corresponding FIELD element (FieldElement
object),
in particular its arraysize
and
datatype
attributes.
What object is returned from each column is described by the following
rules:
Integer
, Float
etc)
will be normally be returned
int[]
, float[]
etc) will normally be returned.
This is stored in column-major order, where that makes a
difference (for arrays with more than one dimension).
char
and unicodeChar
) arrays are
automatically turned into Strings or String arrays, with
dimensionality one less than that suggested by the arraysize
attribute
null
getContentClass(int)
method.Modifier and Type | Method and Description |
---|---|
Object |
getCell(long irow,
int icol)
Returns the contents of a given table cell (optional).
|
int |
getColumnCount()
Returns the number of columns in the table data.
|
Class<?> |
getContentClass(int icol)
Returns a class to which all elements in a given column can be cast.
|
Object[] |
getRow(long irow)
Returns the contents of a given table row (optional).
|
RowAccess |
getRowAccess()
Returns an object which can provide random access for the table data.
|
long |
getRowCount()
Returns the number of rows in the table data.
|
RowSequence |
getRowSequence()
Returns an object which can iterate over all the rows in the
table data sequentially.
|
boolean |
isRandom()
Indicates whether random access is provided by this table.
|
int getColumnCount()
long getRowCount()
isRandom()
returns true.Class<?> getContentClass(int icol)
icol
- the column (0-based)icol
will belongRowSequence getRowSequence() throws IOException
IOException
boolean isRandom()
getRow(long)
and getCell(long, int)
methods be used.true
iff random access methods are availableRowAccess getRowAccess() throws IOException
IOException
- if there is I/O troubleUnsupportedOperationException
- if isRandom
returns falseObject getCell(long irow, int icol) throws IOException
getContentClass(icol)
.
Only provided if getRandom
returns true.irow
- row indexicol
- column indexirow
, icol
IOException
- if there is I/O troubleUnsupportedOperationException
- if isRandom
returns falseObject[] getRow(long irow) throws IOException
getRandom
returns true.irow
- row indexirow
(one cell per column)IOException
- if there is I/O troubleUnsupportedOperationException
- if isRandom
returns falseCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.