# Interface RowAccess

All Superinterfaces:
  `AutoCloseable, Closeable, RowData`

All Known Implementing Classes:
  `EmptyRowSequence, WrapperRowAccess`

public interface RowAccess extends RowData, Closeable
Provides random access to table data. An instance of this class is not in general safe for use from multiple threads.

Since:
  24 Jul 2020
Author:
  Mark Taylor

## Method Summary

Modifier and Type
Method
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.

## Method Details

### setRowIndex

void setRowIndex(long irow) throws IOException
Sets the row index to which subsequent data accesses will refer.

This method must be called before the first invocation of `getCell(int)`/`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.

Parameters:
  `irow` - row index
Throws:
  `IOException`

### getCell

Object getCell(int icol) throws IOException
Returns the contents of a given cell at the current row.

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.

Specified by:
  `getCell` in interface `RowData`
Parameters:
  `icol` - column index
Returns:
  contents of given column at current row
Throws:
  `IOException` - if there's a problem reading the value

### getRow

Object[] getRow() throws IOException
Returns the contents of all the cells at the current row.

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.

Specified by:
  `getRow` in interface `RowData`
Returns:
  array with one element for each column in the table
Throws:
  `IOException`

### close

void close() throws IOException
Closes this reader. The effect of calling any of the other methods following a close is undefined.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`