public class FixedTableRecord extends java.lang.Object implements TableRecord
| Constructor and Description |
|---|
FixedTableRecord(byte[] value,
java.util.Map<java.lang.String,java.lang.Integer> map,
FieldDescription[] fields)
Creates an instance of
FixedTableRecord for reading field values of a fixed-width
table record. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the content of the
TableRecord object. |
int |
findColumn(java.lang.String name)
Gets the integer index of a field with the given name (1-relative).
|
java.math.BigInteger |
getBigInteger(int index)
Gets the field value as a Java BigInteger.
|
java.math.BigInteger |
getBigInteger(java.lang.String name)
Gets the field value as a Java BigInteger.
|
boolean |
getBoolean(int index)
Gets the boolean value of a field given the index.
|
boolean |
getBoolean(java.lang.String name)
Gets the boolean value of a field given the index.
|
byte |
getByte(int index)
Gets the byte value of a field given the index.
|
byte |
getByte(java.lang.String name)
Gets the byte value of a field given the name.
|
double |
getDouble(int index)
Gets the double value of a field given the index.
|
double |
getDouble(java.lang.String name)
Gets the double value of a field given the name.
|
float |
getFloat(int index)
Gets the float value of a field given the index.
|
float |
getFloat(java.lang.String name)
Gets the float value of a field given the name.
|
int |
getInt(int index)
Gets the integer value of a field given the index.
|
int |
getInt(java.lang.String name)
Gets the integer value of a field given the name.
|
RecordLocation |
getLocation() |
long |
getLong(int index)
Gets the long value of a field given the index.
|
long |
getLong(java.lang.String name)
Gets the long value of a field given the name.
|
byte[] |
getRecordValue()
Returns a byte array that stores the record value.
|
short |
getShort(int index)
Gets the short value of a field given the index.
|
short |
getShort(java.lang.String name)
Gets the short value of a field given the name.
|
java.lang.String |
getString(int index)
Gets the string value of a field given the index.
|
java.lang.String |
getString(int index,
java.nio.charset.Charset charset)
Gets the string value of a field given the index.
|
java.lang.String |
getString(java.lang.String name)
Gets the string value of a field given the name.
|
java.lang.String |
getString(java.lang.String name,
java.nio.charset.Charset charset)
Gets the string value of a field given the name.
|
void |
setByte(int index,
byte value)
Sets one byte value to a field given the index.
|
void |
setByte(java.lang.String name,
byte value)
Sets one byte value to a field given the name.
|
void |
setDouble(int index,
double value)
Sets eight bytes containing the double value to a field given the index.
|
void |
setDouble(java.lang.String name,
double value)
Sets eight bytes containing the double value to a field given the name.
|
void |
setFloat(int index,
float value)
Sets four bytes containing the float value to a field given the index.
|
void |
setFloat(java.lang.String name,
float value)
Sets four bytes containing the float value to a field given the name.
|
void |
setInt(int index,
int value)
Sets four bytes containing the integer value to a field given the index.
|
void |
setInt(java.lang.String name,
int value)
Sets four bytes containing the integer value to a field given the name.
|
void |
setLocation(RecordLocation location)
Sets the record location.
|
void |
setLong(int index,
long value)
Sets eight bytes containing the long value to the record given the field index.
|
void |
setLong(java.lang.String name,
long value)
Sets eight bytes containing the long value to the record given the field name.
|
void |
setRecordValue(byte[] value)
Sets the record value.
|
void |
setShort(int index,
short value)
Sets two bytes containing the short value to a field given the index.
|
void |
setShort(java.lang.String name,
short value)
Sets two bytes containing the short value to a field given the index.
|
void |
setString(int index,
java.lang.String value)
Sets a string value to a field given the index.
|
void |
setString(java.lang.String value)
Sets a String value to the record at the current offset.
|
void |
setString(java.lang.String name,
java.lang.String value)
Sets a string value to a field given the name.
|
public FixedTableRecord(byte[] value,
java.util.Map<java.lang.String,java.lang.Integer> map,
FieldDescription[] fields)
FixedTableRecord for reading field values of a fixed-width
table record.value - the record valuemap - a hash mapping field name to field indexfields - an array of field descriptions (field meta data)public int findColumn(java.lang.String name)
TableRecordfindColumn in interface TableRecordname - the name of a fieldpublic boolean getBoolean(java.lang.String name)
TableRecordgetBoolean in interface TableRecordname - the field namepublic boolean getBoolean(int index)
TableRecordgetBoolean in interface TableRecordindex - the field indexpublic short getShort(int index)
TableRecordgetShort in interface TableRecordindex - the column index (1-relative)public short getShort(java.lang.String name)
TableRecordgetShort in interface TableRecordname - the field namepublic byte getByte(int index)
TableRecordgetByte in interface TableRecordindex - the field index (1-relative)public byte getByte(java.lang.String name)
TableRecordgetByte in interface TableRecordname - the field namepublic long getLong(int index)
TableRecordIt throws NumberFormatException if the number is out of range when converting from ASCII_Integer to long.
getLong in interface TableRecordindex - the field index (1-relative)public long getLong(java.lang.String name)
TableRecordgetLong in interface TableRecordname - the field namepublic int getInt(java.lang.String name)
TableRecordgetInt in interface TableRecordname - the field namepublic int getInt(int index)
TableRecordIt throws NumberFormatException if the number is out of range when converting from ASCII_Integer to int.
getInt in interface TableRecordindex - the field index (1-relative)public java.math.BigInteger getBigInteger(java.lang.String name)
TableRecordgetBigInteger in interface TableRecordname - the name of the fieldBigIntegerpublic java.math.BigInteger getBigInteger(int index)
TableRecordgetBigInteger in interface TableRecordindex - the field indexBigIntegerpublic double getDouble(java.lang.String name)
TableRecordgetDouble in interface TableRecordname - the field namepublic double getDouble(int index)
TableRecordIf the number is out of range when converting from ASCII_Real to double, the method returns Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY.
getDouble in interface TableRecordindex - the field index (1-relative)public float getFloat(java.lang.String name)
TableRecordgetFloat in interface TableRecordname - the field namepublic float getFloat(int index)
TableRecordIf the number is out of range when converting from ASCII_Real to float, the method returns Float.POSITIVE_INFINITY or Float.NEGATIVE_INFINITY.
getFloat in interface TableRecordindex - the field index (1-relative)public java.lang.String getString(java.lang.String name)
TableRecordgetString in interface TableRecordname - the field namepublic java.lang.String getString(java.lang.String name,
java.nio.charset.Charset charset)
TableRecordgetString in interface TableRecordname - the field namecharset - the charset to use.public java.lang.String getString(int index)
TableRecordgetString in interface TableRecordindex - the field index (1-relative)public java.lang.String getString(int index,
java.nio.charset.Charset charset)
TableRecordgetString in interface TableRecordindex - the field index (1-relative)charset - The charset to use.public void setString(int index,
java.lang.String value)
TableRecordsetString in interface TableRecordindex - the field index (1-relative)value - a string valuepublic void setString(java.lang.String name,
java.lang.String value)
TableRecordsetString in interface TableRecordname - the field namevalue - a string valuepublic void setString(java.lang.String value)
TableRecordsetString in interface TableRecordvalue - a String valuepublic void setInt(int index,
int value)
TableRecordsetInt in interface TableRecordindex - the field index (1-relative)value - an integer valuepublic void setInt(java.lang.String name,
int value)
TableRecordsetInt in interface TableRecordname - the field namevalue - an integer valuepublic void setDouble(int index,
double value)
TableRecordsetDouble in interface TableRecordindex - the field index (1-relative)value - a double valuepublic void setDouble(java.lang.String name,
double value)
TableRecordsetDouble in interface TableRecordname - the field namevalue - a double valuepublic void setFloat(int index,
float value)
TableRecordsetFloat in interface TableRecordindex - the field index (1-relative)value - a float valuepublic void setFloat(java.lang.String name,
float value)
TableRecordsetFloat in interface TableRecordname - the field namevalue - a float valuepublic void setLong(int index,
long value)
TableRecordsetLong in interface TableRecordindex - the field index (1-relative)value - a long valuepublic void setLong(java.lang.String name,
long value)
TableRecordsetLong in interface TableRecordname - the field namevalue - a long valuepublic void setShort(int index,
short value)
TableRecordsetShort in interface TableRecordindex - the field index (1-relative)value - a short valuepublic void setShort(java.lang.String name,
short value)
TableRecordsetShort in interface TableRecordname - the field namevalue - a short valuepublic void setByte(int index,
byte value)
TableRecordsetByte in interface TableRecordindex - the field index (1-relative)value - a byte valuepublic void setByte(java.lang.String name,
byte value)
TableRecordsetByte in interface TableRecordname - the field namevalue - a byte valuepublic void clear()
TableRecordTableRecord object.clear in interface TableRecordpublic void setRecordValue(byte[] value)
value - byte array that contains the record valuepublic byte[] getRecordValue()
public RecordLocation getLocation()
getLocation in interface TableRecordpublic void setLocation(RecordLocation location)
TableRecordsetLocation in interface TableRecordlocation - the record location.Copyright © 2023 Planetary Data System. All rights reserved.