public class FixedTableRecord extends Object implements TableRecord
| Constructor and Description |
|---|
FixedTableRecord(byte[] value,
Map<String,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(String name)
Gets the integer index of a field with the given name (1-relative).
|
BigInteger |
getBigInteger(int index)
Gets the field value as a Java BigInteger.
|
BigInteger |
getBigInteger(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(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(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(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(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(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(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(String name)
Gets the short value of a field given the name.
|
String |
getString(int index)
Gets the string value of a field given the index.
|
String |
getString(int index,
Charset charset)
Gets the string value of a field given the index.
|
String |
getString(String name)
Gets the string value of a field given the name.
|
String |
getString(String name,
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(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(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(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(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(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(String name,
short value)
Sets two bytes containing the short value to a field given the index.
|
void |
setString(int index,
String value)
Sets a string value to a field given the index.
|
void |
setString(String value)
Sets a String value to the record at the current offset.
|
void |
setString(String name,
String value)
Sets a string value to a field given the name.
|
public FixedTableRecord(byte[] value,
Map<String,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(String name)
TableRecordfindColumn in interface TableRecordname - the name of a fieldpublic boolean getBoolean(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(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(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(String name)
TableRecordgetLong in interface TableRecordname - the field namepublic int getInt(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 BigInteger getBigInteger(String name)
TableRecordgetBigInteger in interface TableRecordname - the name of the fieldBigIntegerpublic BigInteger getBigInteger(int index)
TableRecordgetBigInteger in interface TableRecordindex - the field indexBigIntegerpublic double getDouble(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(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 String getString(String name)
TableRecordgetString in interface TableRecordname - the field namepublic String getString(String name, Charset charset)
TableRecordgetString in interface TableRecordname - the field namecharset - the charset to use.public String getString(int index)
TableRecordgetString in interface TableRecordindex - the field index (1-relative)public String getString(int index, Charset charset)
TableRecordgetString in interface TableRecordindex - the field index (1-relative)charset - The charset to use.public void setString(int index,
String value)
TableRecordsetString in interface TableRecordindex - the field index (1-relative)value - a string valuepublic void setString(String name, String value)
TableRecordsetString in interface TableRecordname - the field namevalue - a string valuepublic void setString(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(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(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(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(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(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(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 © 2021. All rights reserved.