Package gov.nasa.pds.objectAccess
Class RawTableReader
- java.lang.Object
- 
- gov.nasa.pds.objectAccess.TableReader
- 
- gov.nasa.pds.objectAccess.RawTableReader
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable
 
 public class RawTableReader extends TableReader Table reader that provides the capability to read a table line by line rather than record by record, which is more strict as it relies on the label metadata.- Author:
- mcayanan
 
- 
- 
Field Summary- 
Fields inherited from class gov.nasa.pds.objectAccess.TableReaderaccessor, dataObjectLocation
 
- 
 - 
Constructor SummaryConstructors Constructor Description RawTableReader(java.lang.Object table, java.net.URL dataFile, DataObjectLocation location, boolean checkSize)RawTableReader(java.lang.Object table, java.net.URL dataFile, java.net.URL label, DataObjectLocation location, boolean readEntireFile)Constructor.RawTableReader(java.lang.Object table, java.net.URL dataFile, java.net.URL label, DataObjectLocation location, boolean readEntireFile, boolean keepQuotationsFlag)Constructor.RawTableReader(java.lang.Object table, java.net.URL dataFile, java.net.URL label, DataObjectLocation location, boolean readEntireFile, boolean keepQuotationsFlag, java.io.RandomAccessFile raf, java.io.InputStream inputStream)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description TableRecordgetRecord(long index, boolean keepQuotationsFlag)Gets a record in the table.TableRecordreadNext()Reads the next record in the table.java.lang.StringreadNextFixedLine()Previews the next fixed length line in the data file.java.lang.StringreadNextLine()Previews the next line in the data file.FixedTableRecordtoRecord(java.lang.String line, long row)Converts the given line to a record.- 
Methods inherited from class gov.nasa.pds.objectAccess.TableReaderclose, getAccessor, getAdapter, getCurrentRow, getDataObjectLocation, getFieldMap, getFields, getInputStream, getOffset, getRecord, getRecordSize, setCurrentRow, setCurrentRow, setDataObjectLocation
 
- 
 
- 
- 
- 
Constructor Detail- 
RawTableReaderpublic RawTableReader(java.lang.Object table, java.net.URL dataFile, java.net.URL label, DataObjectLocation location, boolean readEntireFile) throws java.lang.ExceptionConstructor.- Parameters:
- table- The table object.
- dataFile- The data file.
- label- The label.
- location- The location of the table within the metadata definition
- readEntireFile- Set to 'true' to read in entire data file.
- Throws:
- java.lang.Exception- If table offset is null.
 
 - 
RawTableReaderpublic RawTableReader(java.lang.Object table, java.net.URL dataFile, java.net.URL label, DataObjectLocation location, boolean readEntireFile, boolean keepQuotationsFlag) throws java.lang.ExceptionConstructor.- Parameters:
- table- The table object.
- dataFile- The data file.
- label- The label.
- location- The location of the table within the metadata definition
- readEntireFile- Set to 'true' to read in entire data file.
- keepQuotationsFlag- Flag to optionally preserve the leading and trailing quotes.
- Throws:
- java.lang.Exception- If table offset is null.
 
 - 
RawTableReaderpublic RawTableReader(java.lang.Object table, java.net.URL dataFile, java.net.URL label, DataObjectLocation location, boolean readEntireFile, boolean keepQuotationsFlag, java.io.RandomAccessFile raf, java.io.InputStream inputStream) throws java.lang.ExceptionConstructor.- Parameters:
- table- The table object.
- dataFile- The data file.
- label- The label.
- location- The location of the table within the metadata definition
- readEntireFile- Set to 'true' to read in entire data file.
- keepQuotationsFlag- Flag to optionally preserve the leading and trailing quotes.
- fileChannel- file channel stream used for ByteWideFileAccessor
- inputStream- input stream of the file used for CSVReader
- Throws:
- java.lang.Exception- If table offset is null.
 
 - 
RawTableReaderpublic RawTableReader(java.lang.Object table, java.net.URL dataFile, DataObjectLocation location, boolean checkSize) throws InvalidTableException, java.lang.Exception- Throws:
- InvalidTableException
- java.lang.Exception
 
 
- 
 - 
Method Detail- 
readNextLinepublic java.lang.String readNextLine() throws java.io.IOExceptionPreviews the next line in the data file.- Returns:
- the next line, or null if no further lines.
- Throws:
- java.io.IOException
 
 - 
readNextFixedLinepublic java.lang.String readNextFixedLine() throws java.io.IOExceptionPreviews the next fixed length line in the data file.- Returns:
- the next line, or null if no further lines.
- Throws:
- java.io.IOException
 
 - 
toRecordpublic FixedTableRecord toRecord(java.lang.String line, long row) Converts the given line to a record.- Parameters:
- line- The line to convert.
- row- The row number to set.
- Returns:
- A record.
 
 - 
readNextpublic TableRecord readNext() throws java.io.IOException Reads the next record in the table.- Overrides:
- readNextin class- TableReader
- Returns:
- a table record, with the location set.
- Throws:
- java.io.IOException
 
 - 
getRecordpublic TableRecord getRecord(long index, boolean keepQuotationsFlag) throws java.lang.IllegalArgumentException, java.io.IOException Gets a record in the table.- Overrides:
- getRecordin class- TableReader
- Parameters:
- The- index of the record.
- Returns:
- a table record, with the location set.
- Throws:
- java.lang.IllegalArgumentException- if index is greater than the record number
- java.io.IOException
 
 
- 
 
-