public class WrapperRowAccess extends Object implements RowAccess
This class is provided so that it can be extended by subclasses which modify the view of the base sequence in useful ways.
WrapperStarTable
Constructor and Description |
---|
WrapperRowAccess(RowAccess baseAcc)
Constructs a new RowAccess based on a given one.
|
WrapperRowAccess(RowAccess baseAcc,
RowData data)
Constructs a new RowAccess based on a given one but with
a supplied data access implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this reader.
|
Object |
getCell(int icol)
Returns the contents of a given cell at the current row.
|
Object[] |
getRow()
Returns the contents of all the cells at the current row.
|
void |
setRowIndex(long irow)
Sets the row index to which subsequent data accesses will refer.
|
String |
toString()
Returns an indication of the wrapper structure of this object.
|
public WrapperRowAccess(RowAccess baseAcc)
baseAcc
- the base row accesspublic WrapperRowAccess(RowAccess baseAcc, RowData data)
baseAcc
- the base row accessdata
- RowData object whose methods will be used
to implement the getCell and getRow methodspublic void setRowIndex(long irow) throws IOException
RowAccess
This method must be called before the first invocation of
RowAccess.getCell(int)
/RowAccess.getRow()
, otherwise behaviour is undefined
(but implementations will likely throw an unchecked exception
on subsequent getCell/getRow calls).
The effect of setting the value to an out of range value is undefined;
it may throw an exception here, or during subsequent calls,
or behave otherwise.
setRowIndex
in interface RowAccess
irow
- row indexIOException
public Object getCell(int icol) throws IOException
RowAccess
Behaviour is undefined if the row index has not been set,
or has been set to a value for which no table row exists;
however implementations are encouraged to throw suitable
RuntimeException
in this case.
getCell
in interface RowAccess
getCell
in interface RowData
icol
- column indexIOException
- if there's a problem reading the valuepublic Object[] getRow() throws IOException
RowAccess
Note the returned object may be reused between invocations,
Behaviour is undefined if the row index has not been set,
or has been set to a value for which no table row exists;
however implementations are encouraged to throw a suitable
RuntimeException
in this case.
getRow
in interface RowAccess
getRow
in interface RowData
IOException
public void close() throws IOException
RowAccess
close
in interface Closeable
close
in interface AutoCloseable
close
in interface RowAccess
IOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.