public class TableReader
extends java.lang.Object
TableReader class defines methods for reading table records.| Modifier and Type | Field and Description |
|---|---|
protected ByteWiseFileAccessor |
accessor |
| Constructor and Description |
|---|
TableReader(java.lang.Object table,
java.io.File dataFile) |
TableReader(java.lang.Object table,
java.net.URL dataFile)
Constructs a
TableReader instance for reading records from a
data file associated with a table object. |
TableReader(java.lang.Object table,
java.net.URL dataFile,
boolean checkSize) |
TableReader(java.lang.Object table,
java.net.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() |
java.util.Map<java.lang.String,java.lang.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(java.lang.Object table,
java.io.File dataFile)
throws java.lang.Exception
java.lang.Exceptionpublic TableReader(java.lang.Object table,
java.net.URL dataFile)
throws java.lang.Exception
TableReader instance for reading records from a
data file associated with a table object.table - a table objectdataFile - an input data filejava.lang.NullPointerException - if table offset is nulljava.lang.Exceptionpublic TableReader(java.lang.Object table,
java.net.URL dataFile,
boolean checkSize)
throws java.lang.Exception
java.lang.Exceptionpublic TableReader(java.lang.Object table,
java.net.URL dataFile,
boolean checkSize,
boolean readEntireFile)
throws java.lang.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.java.lang.NullPointerException - if table offset is nulljava.lang.Exceptionpublic TableAdapter getAdapter()
public FieldDescription[] getFields()
public java.util.Map<java.lang.String,java.lang.Integer> getFieldMap()
public TableRecord readNext() throws java.io.IOException
java.io.IOExceptionpublic TableRecord getRecord(int index) throws java.lang.IllegalArgumentException, java.io.IOException
index - the record index (1-relative)TableRecordjava.lang.IllegalArgumentException - if index is greater than the record numberjava.io.IOExceptionpublic void setCurrentRow(int row)
row - The row to set.public int getCurrentRow()
public ByteWiseFileAccessor getAccessor()
Copyright © 2010-2018 Planetary Data System. All Rights Reserved.