public class RadixTextFieldAdapter
extends gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
This class is written with reference to gov.nasa.pds.objectAccess.table.NumericTextFieldAdapter; this implementation just adds a radix where appropriate to provide I/O in a non-decimal base.
Constructor and Description |
---|
RadixTextFieldAdapter(int radix)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
getBigInteger(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java BigInteger.
|
byte |
getByte(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java byte.
|
double |
getDouble(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java double.
|
float |
getFloat(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java float.
|
int |
getInt(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java int.
|
long |
getLong(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java long.
|
short |
getShort(byte[] buf,
int offset,
int length,
int startBit,
int stopBit)
Gets the field value as a Java short.
|
void |
setBigInteger(java.math.BigInteger value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java BigInteger.
|
void |
setByte(byte value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java byte.
|
void |
setDouble(double value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java double.
|
void |
setFloat(float value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java float.
|
void |
setInt(int value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java int.
|
void |
setLong(long value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java long.
|
void |
setShort(short value,
int offset,
int length,
java.nio.ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java short.
|
public RadixTextFieldAdapter(int radix)
radix
- numeric base in which values are representedpublic byte getByte(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getByte
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getByte
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldspublic short getShort(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getShort
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getShort
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldspublic int getInt(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getInt
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getInt
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldspublic long getLong(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getLong
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getLong
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldspublic float getFloat(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getFloat
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getFloat
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldspublic double getDouble(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getDouble
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getDouble
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldspublic java.math.BigInteger getBigInteger(byte[] buf, int offset, int length, int startBit, int stopBit)
gov.nasa.pds.objectAccess.table.FieldAdapter
getBigInteger
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
getBigInteger
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
buf
- the byte array containing the fieldoffset
- the field offsetlength
- the length of the field datastartBit
- the start bit, for bit fieldsstopBit
- the stop bit, for bit fieldsBigInteger
public void setByte(byte value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setByte
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setByte
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justifiedpublic void setShort(short value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setShort
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setShort
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justifiedpublic void setInt(int value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setInt
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setInt
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justifiedpublic void setLong(long value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setLong
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setLong
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justifiedpublic void setFloat(float value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setFloat
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setFloat
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justifiedpublic void setDouble(double value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setDouble
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setDouble
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justifiedpublic void setBigInteger(java.math.BigInteger value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
gov.nasa.pds.objectAccess.table.FieldAdapter
setBigInteger
in interface gov.nasa.pds.objectAccess.table.FieldAdapter
setBigInteger
in class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the valuebuffer
- the byte buffer into which to set the valueisRightJustified
- true, if the string value should be right-justified