public class TableReader extends Object
TableReader class defines methods for reading table records.| Modifier and Type | Field and Description |
|---|---|
protected ByteWiseFileAccessor |
accessor |
| Constructor and Description |
|---|
TableReader(Object table,
File dataFile) |
TableReader(Object table,
URL dataFile)
Constructs a
TableReader instance for reading records from a
data file associated with a table object. |
TableReader(Object table,
URL dataFile,
boolean checkSize) |
TableReader(Object table,
URL dataFile,
boolean checkSize,
boolean readEntireFile)
Constructs a
TableReader instance for reading records from a
data file associated with a table object. |
| Modifier and Type | Method and Description |
|---|---|
ByteWiseFileAccessor |
getAccessor() |
TableAdapter |
getAdapter() |
int |
getCurrentRow() |
Map<String,Integer> |
getFieldMap() |
FieldDescription[] |
getFields()
Gets the field descriptions for fields in the table.
|
TableRecord |
getRecord(int index)
Gets access to the table record given the index.
|
TableRecord |
readNext()
Reads the next record from the data file.
|
void |
setCurrentRow(int row)
Sets the current row.
|
protected ByteWiseFileAccessor accessor
public TableReader(Object table, URL dataFile) throws Exception
TableReader instance for reading records from a
data file associated with a table object.table - a table objectdataFile - an input data fileNullPointerException - if table offset is nullExceptionpublic TableReader(Object table, URL dataFile, boolean checkSize) throws Exception
Exceptionpublic TableReader(Object table, URL dataFile, boolean checkSize, boolean readEntireFile) throws Exception
TableReader instance for reading records from a
data file associated with a table object.table - a table objectdataFile - an input data filecheckSize - check that the size of the data file is equal to the
size of the table (length * records) + offset.NullPointerException - if table offset is nullExceptionpublic TableAdapter getAdapter()
public FieldDescription[] getFields()
public TableRecord readNext() throws IOException
IOExceptionpublic TableRecord getRecord(int index) throws IllegalArgumentException, IOException
index - the record index (1-relative)TableRecordIllegalArgumentException - if index is greater than the record numberIOExceptionpublic void setCurrentRow(int row)
row - The row to set.public int getCurrentRow()
public ByteWiseFileAccessor getAccessor()
Copyright © 2010–2017 Planetary Data System. All rights reserved.