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)
TableRecord
findColumn
in interface TableRecord
name
- the name of a fieldpublic boolean getBoolean(String name)
TableRecord
getBoolean
in interface TableRecord
name
- the field namepublic boolean getBoolean(int index)
TableRecord
getBoolean
in interface TableRecord
index
- the field indexpublic short getShort(int index)
TableRecord
getShort
in interface TableRecord
index
- the column index (1-relative)public short getShort(String name)
TableRecord
getShort
in interface TableRecord
name
- the field namepublic byte getByte(int index)
TableRecord
getByte
in interface TableRecord
index
- the field index (1-relative)public byte getByte(String name)
TableRecord
getByte
in interface TableRecord
name
- the field namepublic long getLong(int index)
TableRecord
It throws NumberFormatException if the number is out of range when converting from ASCII_Integer to long.
getLong
in interface TableRecord
index
- the field index (1-relative)public long getLong(String name)
TableRecord
getLong
in interface TableRecord
name
- the field namepublic int getInt(String name)
TableRecord
getInt
in interface TableRecord
name
- the field namepublic int getInt(int index)
TableRecord
It throws NumberFormatException if the number is out of range when converting from ASCII_Integer to int.
getInt
in interface TableRecord
index
- the field index (1-relative)public BigInteger getBigInteger(String name)
TableRecord
getBigInteger
in interface TableRecord
name
- the name of the fieldBigInteger
public BigInteger getBigInteger(int index)
TableRecord
getBigInteger
in interface TableRecord
index
- the field indexBigInteger
public double getDouble(String name)
TableRecord
getDouble
in interface TableRecord
name
- the field namepublic double getDouble(int index)
TableRecord
If 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 TableRecord
index
- the field index (1-relative)public float getFloat(String name)
TableRecord
getFloat
in interface TableRecord
name
- the field namepublic float getFloat(int index)
TableRecord
If 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 TableRecord
index
- the field index (1-relative)public String getString(String name)
TableRecord
getString
in interface TableRecord
name
- the field namepublic String getString(String name, Charset charset)
TableRecord
getString
in interface TableRecord
name
- the field namecharset
- the charset to use.public String getString(int index)
TableRecord
getString
in interface TableRecord
index
- the field index (1-relative)public String getString(int index, Charset charset)
TableRecord
getString
in interface TableRecord
index
- the field index (1-relative)charset
- The charset to use.public void setString(int index, String value)
TableRecord
setString
in interface TableRecord
index
- the field index (1-relative)value
- a string valuepublic void setString(String name, String value)
TableRecord
setString
in interface TableRecord
name
- the field namevalue
- a string valuepublic void setString(String value)
TableRecord
setString
in interface TableRecord
value
- a String valuepublic void setInt(int index, int value)
TableRecord
setInt
in interface TableRecord
index
- the field index (1-relative)value
- an integer valuepublic void setInt(String name, int value)
TableRecord
setInt
in interface TableRecord
name
- the field namevalue
- an integer valuepublic void setDouble(int index, double value)
TableRecord
setDouble
in interface TableRecord
index
- the field index (1-relative)value
- a double valuepublic void setDouble(String name, double value)
TableRecord
setDouble
in interface TableRecord
name
- the field namevalue
- a double valuepublic void setFloat(int index, float value)
TableRecord
setFloat
in interface TableRecord
index
- the field index (1-relative)value
- a float valuepublic void setFloat(String name, float value)
TableRecord
setFloat
in interface TableRecord
name
- the field namevalue
- a float valuepublic void setLong(int index, long value)
TableRecord
setLong
in interface TableRecord
index
- the field index (1-relative)value
- a long valuepublic void setLong(String name, long value)
TableRecord
setLong
in interface TableRecord
name
- the field namevalue
- a long valuepublic void setShort(int index, short value)
TableRecord
setShort
in interface TableRecord
index
- the field index (1-relative)value
- a short valuepublic void setShort(String name, short value)
TableRecord
setShort
in interface TableRecord
name
- the field namevalue
- a short valuepublic void setByte(int index, byte value)
TableRecord
setByte
in interface TableRecord
index
- the field index (1-relative)value
- a byte valuepublic void setByte(String name, byte value)
TableRecord
setByte
in interface TableRecord
name
- the field namevalue
- a byte valuepublic void clear()
TableRecord
TableRecord
object.clear
in interface TableRecord
public void setRecordValue(byte[] value)
value
- byte array that contains the record valuepublic byte[] getRecordValue()
public RecordLocation getLocation()
getLocation
in interface TableRecord
public void setLocation(RecordLocation location)
TableRecord
setLocation
in interface TableRecord
location
- the record location.Copyright © 2010–2018 Planetary Data System. All rights reserved.