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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FieldDescription
getField(int index)
Returns the field at a given index.int
getFieldCount()
Gets the number of fields in each record.char
getFieldDelimiter()
Gets the field delimiter.FieldDescription[]
getFields()
Gets the definitions of fields from the table.java.util.List<FieldDescription>
getFieldsList()
Gets the definitions of fields from the table.int
getMaximumRecordLength()
Gets the maximum length of each record.long
getOffset()
Gets the offset into the data file where the table starts.long
getRecordCount()
Gets the number of records in the table.java.lang.String
getRecordDelimiter()
Gets the record delimiter.int
getRecordLength()
Gets the length of each record.
-
-
-
Method Detail
-
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
FieldDescription getField(int index)
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
java.util.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
java.lang.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
-
-