Package gov.nasa.pds.label.object
Class TableObject
- java.lang.Object
- 
- gov.nasa.pds.label.object.DataObject
- 
- gov.nasa.pds.label.object.TableObject
 
 
- 
 public class TableObject extends DataObject Implements an object that represents a table in a PDS product. The table may be binary, character, or delimited.
- 
- 
Field Summary- 
Fields inherited from class gov.nasa.pds.label.object.DataObjectchannel, dataObjectLocation, fileObject, localIdentifier, name, offset, parentDir
 
- 
 - 
Constructor SummaryConstructors Constructor Description TableObject(java.io.File parentDir, File fileObject, java.lang.Object tableObject, long offset, long size)Deprecated.TableObject(java.io.File parentDir, File fileObject, java.lang.Object tableObject, long offset, long size, DataObjectLocation location)Creates a new instance of the table object.TableObject(java.net.URL parentDir, File fileObject, java.lang.Object tableObject, long offset, long size)Deprecated.TableObject(java.net.URL parentDir, File fileObject, java.lang.Object tableObject, long offset, long size, DataObjectLocation location)Creates a new instance of the table object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDescription[]getFields()Gets the field descriptions for fields in the table.RawTableReadergetRawTableReader()Returns a raw table reader for this table.TableRecordgetRecord(int index, boolean keepQuotationsFlag)Gets access to the table record given the index.java.lang.ObjectgetTableObject()TableReadergetTableReader()Returns a table reader for this table.TableRecordreadNext()Reads the next record from the data file.voidsetTableObject(java.lang.Object tableObject)- 
Methods inherited from class gov.nasa.pds.label.object.DataObjectcloseChannel, getChannel, getDataFile, getDataObjectLocation, getInputStream, getLocalIdentifier, getName, getOffset, getSize, setDataObjectLocation, setLocalIdentifier, setName, setSize
 
- 
 
- 
- 
- 
Constructor Detail- 
TableObjectpublic TableObject(java.io.File parentDir, File fileObject, java.lang.Object tableObject, long offset, long size, DataObjectLocation location) throws java.lang.ExceptionCreates a new instance of the table object.- Parameters:
- parentDir- the parent directory for the table object
- fileObject- the file object describing the data file
- tableObject- the table object describing the table
- offset- the offset of the table object within the data file
- size- the size of the table object, in bytes
- Throws:
- java.lang.Exception- if there is any error accessing the table
 
 - 
TableObjectpublic TableObject(java.net.URL parentDir, File fileObject, java.lang.Object tableObject, long offset, long size, DataObjectLocation location) throws java.lang.ExceptionCreates a new instance of the table object.- Parameters:
- parentDir- the parent directory for the table object
- fileObject- the file object describing the data file
- tableObject- the table object describing the table
- offset- the offset of the table object within the data file
- size- the size of the table object, in bytes
- Throws:
- java.lang.Exception- if there is any error accessing the table
 
 - 
TableObject@Deprecated public TableObject(java.io.File parentDir, File fileObject, java.lang.Object tableObject, long offset, long size) throws java.lang.ExceptionDeprecated.Deprecated initializer. Missing DataObjectLocation- Throws:
- java.lang.Exception
 
 - 
TableObject@Deprecated public TableObject(java.net.URL parentDir, File fileObject, java.lang.Object tableObject, long offset, long size) throws java.lang.ExceptionDeprecated.Deprecated initializer. Missing DataObjectLocation- Throws:
- java.lang.Exception
 
 
- 
 - 
Method Detail- 
getTableReaderpublic TableReader getTableReader() throws java.lang.Exception Returns a table reader for this table.- Returns:
- a table reader
- Throws:
- java.lang.Exception- if there is an error creating the table reader
 
 - 
getRawTableReaderpublic RawTableReader getRawTableReader() throws java.lang.Exception Returns a raw table reader for this table.- Returns:
- a table reader
- Throws:
- java.lang.Exception- if there is an error creating the table reader
 
 - 
getFieldspublic FieldDescription[] getFields() throws java.lang.Exception Gets the field descriptions for fields in the table.- Returns:
- an array of field descriptions
- Throws:
- java.lang.Exception
 
 - 
readNextpublic TableRecord readNext() throws java.io.IOException, com.opencsv.exceptions.CsvValidationException, java.lang.Exception Reads the next record from the data file.- Returns:
- the next record, or null if no further records.
- Throws:
- java.io.IOException- if there is an error reading from the data file
- com.opencsv.exceptions.CsvValidationException
- java.lang.Exception
 
 - 
getRecordpublic TableRecord getRecord(int index, boolean keepQuotationsFlag) throws java.lang.Exception Gets access to the table record given the index. The current row is set to this index, thus, subsequent call to readNext() gets the next record from this position.- Parameters:
- index- the record index (1-relative)
- Returns:
- an instance of TableRecord
- Throws:
- java.lang.Exception
 
 - 
getTableObjectpublic java.lang.Object getTableObject() 
 - 
setTableObjectpublic void setTableObject(java.lang.Object tableObject) 
 
- 
 
-