Package gov.nasa.pds.objectAccess.table
Interface TableAdapter
- All Known Implementing Classes:
TableBinaryAdapter,TableCharacterAdapter,TableDelimitedAdapter
public interface TableAdapter
Defines a facade object that gives access to a table, either binary fixed, character fixed, or
delimited.
-
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.
-
Method Details
-
getRecordCount
long getRecordCount()Gets the number of records in the table.- Returns:
- the number of records
-
getFieldCount
int getFieldCount()Gets 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- Returns:
- the number of fields
-
getField
Returns 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.- Parameters:
index- the field index- Returns:
- the field description
-
getFields
FieldDescription[] getFields()Gets 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.- Returns:
- an array of field descriptions
-
getFieldsList
List<FieldDescription> getFieldsList()Gets 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.- Returns:
- an array of field descriptions
-
getOffset
long getOffset()Gets the offset into the data file where the table starts.- Returns:
- the table offset
-
getRecordLength
int getRecordLength()Gets 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- Returns:
- the record length, or zero for a delimited table
-
getMaximumRecordLength
int getMaximumRecordLength()Gets the maximum length of each record. Optional only for delimited tables. Will return -1 if not available.- Returns:
- the maximum record lengths
-
getRecordDelimiter
String getRecordDelimiter()Gets the record delimiter. For binary tables the record delimiter is not defined, so null is returned.- Returns:
- the record delimiter, or null for binary table
-
getFieldDelimiter
char getFieldDelimiter()Gets the field delimiter. For non-delimited tables, will return 0.- Returns:
- the field delimiter, or 0 for non-delimited table
-