Package gov.nasa.pds.label.object
Interface TableRecord
- 
- All Known Implementing Classes:
- DelimitedTableRecord,- FixedTableRecord
 
 public interface TableRecordDefines an object for table records that can read the field values or write values to the fields given a field name or field index.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Clears the content of theTableRecordobject.intfindColumn(java.lang.String name)Gets the integer index of a field with the given name (1-relative).java.math.BigIntegergetBigInteger(int index)Gets the field value as a Java BigInteger.java.math.BigIntegergetBigInteger(java.lang.String name)Gets the field value as a Java BigInteger.booleangetBoolean(int index)Gets the boolean value of a field given the index.booleangetBoolean(java.lang.String name)Gets the boolean value of a field given the index.bytegetByte(int index)Gets the byte value of a field given the index.bytegetByte(java.lang.String name)Gets the byte value of a field given the name.doublegetDouble(int index)Gets the double value of a field given the index.doublegetDouble(java.lang.String name)Gets the double value of a field given the name.floatgetFloat(int index)Gets the float value of a field given the index.floatgetFloat(java.lang.String name)Gets the float value of a field given the name.intgetInt(int index)Gets the integer value of a field given the index.intgetInt(java.lang.String name)Gets the integer value of a field given the name.RecordLocationgetLocation()longgetLong(int index)Gets the long value of a field given the index.longgetLong(java.lang.String name)Gets the long value of a field given the name.shortgetShort(int index)Gets the short value of a field given the index.shortgetShort(java.lang.String name)Gets the short value of a field given the name.java.lang.StringgetString(int index)Gets the string value of a field given the index.java.lang.StringgetString(int index, java.nio.charset.Charset charset)Gets the string value of a field given the index.java.lang.StringgetString(java.lang.String name)Gets the string value of a field given the name.java.lang.StringgetString(java.lang.String name, java.nio.charset.Charset charset)Gets the string value of a field given the name.intlength()voidsetByte(int index, byte value)Sets one byte value to a field given the index.voidsetByte(java.lang.String name, byte value)Sets one byte value to a field given the name.voidsetDouble(int index, double value)Sets eight bytes containing the double value to a field given the index.voidsetDouble(java.lang.String name, double value)Sets eight bytes containing the double value to a field given the name.voidsetFloat(int index, float value)Sets four bytes containing the float value to a field given the index.voidsetFloat(java.lang.String name, float value)Sets four bytes containing the float value to a field given the name.voidsetInt(int index, int value)Sets four bytes containing the integer value to a field given the index.voidsetInt(java.lang.String name, int value)Sets four bytes containing the integer value to a field given the name.voidsetLocation(RecordLocation location)Sets the record location.voidsetLong(int index, long value)Sets eight bytes containing the long value to the record given the field index.voidsetLong(java.lang.String name, long value)Sets eight bytes containing the long value to the record given the field name.voidsetShort(int index, short value)Sets two bytes containing the short value to a field given the index.voidsetShort(java.lang.String name, short value)Sets two bytes containing the short value to a field given the index.voidsetString(int index, java.lang.String value)Sets a string value to a field given the index.voidsetString(java.lang.String value)Sets a String value to the record at the current offset.voidsetString(java.lang.String name, java.lang.String value)Sets a string value to a field given the name.
 
- 
- 
- 
Method Detail- 
findColumnint findColumn(java.lang.String name) Gets the integer index of a field with the given name (1-relative).- Parameters:
- name- the name of a field
- Returns:
- the integer index of a field (1-relative)
 
 - 
getBooleanboolean getBoolean(java.lang.String name) Gets the boolean value of a field given the index.- Parameters:
- name- the field name
- Returns:
- the boolean value
- Throws:
- java.lang.IllegalArgumentException- if the value in the field is not a valid boolean value
 
 - 
getBooleanboolean getBoolean(int index) Gets the boolean value of a field given the index.- Parameters:
- index- the field index
- Returns:
- the boolean value
- Throws:
- java.lang.IllegalArgumentException- if the value in the field is not a valid boolean value
 
 - 
getShortshort getShort(int index) Gets the short value of a field given the index.- Parameters:
- index- the column index (1-relative)
- Returns:
- a short value
- Throws:
- java.lang.IllegalArgumentException- If cannot convert the number to short
 
 - 
getShortshort getShort(java.lang.String name) Gets the short value of a field given the name.- Parameters:
- name- the field name
- Returns:
- a short value
 
 - 
getBytebyte getByte(int index) Gets the byte value of a field given the index.- Parameters:
- index- the field index (1-relative)
- Returns:
- a byte value
- Throws:
- java.lang.IllegalArgumentException- If cannot convert the number to byte
 
 - 
getBytebyte getByte(java.lang.String name) Gets the byte value of a field given the name.- Parameters:
- name- the field name
- Returns:
- a byte value
 
 - 
getLonglong getLong(int index) Gets the long value of a field given the index.It throws NumberFormatException if the number is out of range when converting from ASCII_Integer to long. - Parameters:
- index- the field index (1-relative)
- Returns:
- a long value
- Throws:
- java.lang.IllegalArgumentException- If cannot convert the number to long
- java.lang.NumberFormatException- If the number is out of range for a long
 
 - 
getLonglong getLong(java.lang.String name) Gets the long value of a field given the name.- Parameters:
- name- the field name
- Returns:
- a long value
 
 - 
getBigIntegerjava.math.BigInteger getBigInteger(java.lang.String name) Gets the field value as a Java BigInteger.- Parameters:
- name- the name of the field
- Returns:
- the field value, as a BigInteger
 
 - 
getBigIntegerjava.math.BigInteger getBigInteger(int index) Gets the field value as a Java BigInteger.- Parameters:
- index- the field index
- Returns:
- the field value, as a BigInteger
 
 - 
getIntint getInt(java.lang.String name) Gets the integer value of a field given the name.- Parameters:
- name- the field name
- Returns:
- an integer value
 
 - 
getIntint getInt(int index) Gets the integer value of a field given the index.It throws NumberFormatException if the number is out of range when converting from ASCII_Integer to int. - Parameters:
- index- the field index (1-relative)
- Returns:
- an integer value
- Throws:
- java.lang.IllegalArgumentException- If cannot convert the number to int
- java.lang.NumberFormatException- If the number is out of range for an int
 
 - 
getDoubledouble getDouble(java.lang.String name) Gets the double value of a field given the name.- Parameters:
- name- the field name
- Returns:
- a double value
 
 - 
getDoubledouble getDouble(int index) Gets the double value of a field given the index.If the number is out of range when converting from ASCII_Real to double, the method returns Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY. - Parameters:
- index- the field index (1-relative)
- Returns:
- a double value
- Throws:
- java.lang.IllegalArgumentException- If cannot convert the number to double
 
 - 
getFloatfloat getFloat(java.lang.String name) Gets the float value of a field given the name.- Parameters:
- name- the field name
- Returns:
- a float value
 
 - 
getFloatfloat getFloat(int index) Gets the float value of a field given the index.If the number is out of range when converting from ASCII_Real to float, the method returns Float.POSITIVE_INFINITY or Float.NEGATIVE_INFINITY. - Parameters:
- index- the field index (1-relative)
- Returns:
- a float value
- Throws:
- java.lang.IllegalArgumentException- If cannot convert the number to float
 
 - 
getStringjava.lang.String getString(java.lang.String name) Gets the string value of a field given the name.- Parameters:
- name- the field name
- Returns:
- a String value
 
 - 
getStringjava.lang.String getString(java.lang.String name, java.nio.charset.Charset charset)Gets the string value of a field given the name.- Parameters:
- name- the field name
- charset- the charset to use.
- Returns:
- a String value
 
 - 
getStringjava.lang.String getString(int index) Gets the string value of a field given the index.- Parameters:
- index- the field index (1-relative)
- Returns:
- a String value
- Throws:
- java.lang.IllegalArgumentException- If data type is not supported
 
 - 
getStringjava.lang.String getString(int index, java.nio.charset.Charset charset)Gets the string value of a field given the index.- Parameters:
- index- the field index (1-relative)
- charset- The charset to use.
- Returns:
- a String value
- Throws:
- java.lang.IllegalArgumentException- If data type is not supported
 
 - 
setStringvoid setString(int index, java.lang.String value)Sets a string value to a field given the index. In a fixed-width text file, numeric values are right justified and non-numeric values are left justified.- Parameters:
- index- the field index (1-relative)
- value- a string value
- Throws:
- java.lang.IllegalArgumentException- If the size of the value is greater than the field length
 
 - 
setStringvoid setString(java.lang.String name, java.lang.String value)Sets a string value to a field given the name. In a fixed-width text file, numeric values are right justified and non-numeric values are left justified.- Parameters:
- name- the field name
- value- a string value
- Throws:
- java.lang.IllegalArgumentException- If the size of the value is greater than field length
 
 - 
setStringvoid setString(java.lang.String value) Sets a String value to the record at the current offset. Use this method to write a field delimiter in fixed-width text file.- Parameters:
- value- a String value
 
 - 
setIntvoid setInt(int index, int value)Sets four bytes containing the integer value to a field given the index.- Parameters:
- index- the field index (1-relative)
- value- an integer value
 
 - 
setIntvoid setInt(java.lang.String name, int value)Sets four bytes containing the integer value to a field given the name.- Parameters:
- name- the field name
- value- an integer value
 
 - 
setDoublevoid setDouble(int index, double value)Sets eight bytes containing the double value to a field given the index.- Parameters:
- index- the field index (1-relative)
- value- a double value
 
 - 
setDoublevoid setDouble(java.lang.String name, double value)Sets eight bytes containing the double value to a field given the name.- Parameters:
- name- the field name
- value- a double value
 
 - 
setFloatvoid setFloat(int index, float value)Sets four bytes containing the float value to a field given the index.- Parameters:
- index- the field index (1-relative)
- value- a float value
 
 - 
setFloatvoid setFloat(java.lang.String name, float value)Sets four bytes containing the float value to a field given the name.- Parameters:
- name- the field name
- value- a float value
 
 - 
setShortvoid setShort(int index, short value)Sets two bytes containing the short value to a field given the index.- Parameters:
- index- the field index (1-relative)
- value- a short value
 
 - 
setShortvoid setShort(java.lang.String name, short value)Sets two bytes containing the short value to a field given the index.- Parameters:
- name- the field name
- value- a short value
 
 - 
setBytevoid setByte(int index, byte value)Sets one byte value to a field given the index.- Parameters:
- index- the field index (1-relative)
- value- a byte value
 
 - 
setBytevoid setByte(java.lang.String name, byte value)Sets one byte value to a field given the name.- Parameters:
- name- the field name
- value- a byte value
 
 - 
setLongvoid setLong(int index, long value)Sets eight bytes containing the long value to the record given the field index.- Parameters:
- index- the field index (1-relative)
- value- a long value
 
 - 
setLongvoid setLong(java.lang.String name, long value)Sets eight bytes containing the long value to the record given the field name.- Parameters:
- name- the field name
- value- a long value
 
 - 
clearvoid clear() Clears the content of theTableRecordobject.
 - 
lengthint length() 
 - 
getLocationRecordLocation getLocation() - Returns:
- Gets the record location.
 
 - 
setLocationvoid setLocation(RecordLocation location) Sets the record location.- Parameters:
- location- the record location.
 
 
- 
 
-