Package gov.nasa.pds.objectAccess.table
Class TableBinaryAdapter
- java.lang.Object
-
- gov.nasa.pds.objectAccess.table.TableBinaryAdapter
-
- All Implemented Interfaces:
TableAdapter
public class TableBinaryAdapter extends java.lang.Object implements TableAdapter
-
-
Constructor Summary
Constructors Constructor Description TableBinaryAdapter(TableBinary table)Creates a new instance for a particular table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDescriptiongetField(int index)Returns the field at a given index.intgetFieldCount()Gets the number of fields in each record.chargetFieldDelimiter()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.intgetMaximumRecordLength()Gets the maximum length of each record.longgetOffset()Gets the offset into the data file where the table starts.longgetRecordCount()Gets the number of records in the table.java.lang.StringgetRecordDelimiter()Gets the record delimiter.intgetRecordLength()Gets the length of each record.
-
-
-
Constructor Detail
-
TableBinaryAdapter
public TableBinaryAdapter(TableBinary table) throws InvalidTableException
Creates a new instance for a particular table.- Parameters:
table- the table- Throws:
InvalidTableException
-
-
Method Detail
-
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
public FieldDescription getField(int index)
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
public FieldDescription[] 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
-
getFieldsList
public java.util.List<FieldDescription> 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
-
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
public java.lang.String 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
-
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
-
-