Package gov.nasa.pds.objectAccess.table
Class TableDelimitedAdapter
java.lang.Object
gov.nasa.pds.objectAccess.table.TableDelimitedAdapter
- All Implemented Interfaces:
TableAdapter
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance for a particular table. -
Method Summary
Modifier and TypeMethodDescriptiongetField(int index) Returns the field at a given index.intGets the number of fields in each record.charGets the field delimiter.Gets the definitions of fields from the table.Gets the definitions of fields from the table.intGets the maximum length of each record.longGets the offset into the data file where the table starts.longGets the number of records in the table.Gets the record delimiter.intGets the length of each record.
-
Constructor Details
-
TableDelimitedAdapter
Creates a new instance for a particular table.- Parameters:
table- the table- Throws:
InvalidTableException
-
-
Method Details
-
getRecordCount
public long getRecordCount()Description copied from interface:TableAdapterGets the number of records in the table.- Specified by:
getRecordCountin interfaceTableAdapter- Returns:
- the number of records
-
getFieldCount
public int getFieldCount()Description copied from interface:TableAdapterGets the number of fields in each record. TODO This should really be a long value, but this would require a ton of changes in the code so we will attack this problem when we get there. Data with num fields larger than max int should not happen- Specified by:
getFieldCountin interfaceTableAdapter- Returns:
- the number of fields
-
getField
Description copied from interface:TableAdapterReturns the field at a given index. This field will be a simple field or a bit field. All grouped fields will have been expanded to their instances.- Specified by:
getFieldin interfaceTableAdapter- Parameters:
index- the field index- Returns:
- the field description
-
getFields
Description copied from interface:TableAdapterGets the definitions of fields from the table. The fields will be a simple field or a bit field. All grouped fields will have been expanded to their instances.- Specified by:
getFieldsin interfaceTableAdapter- Returns:
- an array of field descriptions
-
getOffset
public long getOffset()Description copied from interface:TableAdapterGets the offset into the data file where the table starts.- Specified by:
getOffsetin interfaceTableAdapter- Returns:
- the table offset
-
getRecordLength
public int getRecordLength()Description copied from interface:TableAdapterGets the length of each record. For delimited tables the record length is not defined, so -1 is returned. TODO This should really be a long value, but this would require a ton of changes in the code we will attack this problem when we get there. Data with record length larger than max int should not happen- Specified by:
getRecordLengthin interfaceTableAdapter- Returns:
- the record length, or zero for a delimited table
-
getRecordDelimiter
Description copied from interface:TableAdapterGets the record delimiter. For binary tables the record delimiter is not defined, so null is returned.- Specified by:
getRecordDelimiterin interfaceTableAdapter- Returns:
- the record delimiter, or null for binary table
-
getFieldDelimiter
public char getFieldDelimiter()Description copied from interface:TableAdapterGets the field delimiter. For non-delimited tables, will return 0.- Specified by:
getFieldDelimiterin interfaceTableAdapter- Returns:
- the field delimiter, or 0 for non-delimited table
-
getFieldsList
Description copied from interface:TableAdapterGets the definitions of fields from the table. The fields will be a simple field or a bit field. All grouped fields will have been expanded to their instances.- Specified by:
getFieldsListin interfaceTableAdapter- Returns:
- an array of field descriptions
-
getMaximumRecordLength
public int getMaximumRecordLength()Description copied from interface:TableAdapterGets the maximum length of each record. Optional only for delimited tables. Will return -1 if not available.- Specified by:
getMaximumRecordLengthin interfaceTableAdapter- Returns:
- the maximum record lengths
-