Package gov.nasa.pds.objectAccess.table
Class NumericTextFieldAdapter
- java.lang.Object
-
- gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
-
- gov.nasa.pds.objectAccess.table.NumericTextFieldAdapter
-
- All Implemented Interfaces:
FieldAdapter
public class NumericTextFieldAdapter extends DefaultFieldAdapter
Implements a field adapter for numeric fields stored in textual format, as in a character table.
-
-
Field Summary
Fields Modifier and Type Field Description int
radix
-
Constructor Summary
Constructors Constructor Description NumericTextFieldAdapter(int radix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getByte
public byte getByte(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java byte.- Specified by:
getByte
in interfaceFieldAdapter
- Overrides:
getByte
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as a short
-
getShort
public short getShort(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java short.- Specified by:
getShort
in interfaceFieldAdapter
- Overrides:
getShort
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as a short
-
getInt
public int getInt(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java int.- Specified by:
getInt
in interfaceFieldAdapter
- Overrides:
getInt
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as an int
-
getLong
public long getLong(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java long.- Specified by:
getLong
in interfaceFieldAdapter
- Overrides:
getLong
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as a long
-
getFloat
public float getFloat(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java float.- Specified by:
getFloat
in interfaceFieldAdapter
- Overrides:
getFloat
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as a float
-
getDouble
public double getDouble(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java double.- Specified by:
getDouble
in interfaceFieldAdapter
- Overrides:
getDouble
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as a double
-
getBigInteger
public java.math.BigInteger getBigInteger(byte[] buf, int offset, int length, int startBit, int stopBit)
Description copied from interface:FieldAdapter
Gets the field value as a Java BigInteger.- Specified by:
getBigInteger
in interfaceFieldAdapter
- Overrides:
getBigInteger
in classDefaultFieldAdapter
- Parameters:
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 fields- Returns:
- the field value, as a
BigInteger
-
setByte
public void setByte(byte value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java byte.- Specified by:
setByte
in interfaceFieldAdapter
- Overrides:
setByte
in classDefaultFieldAdapter
- Parameters:
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
-
setShort
public void setShort(short value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java short.- Specified by:
setShort
in interfaceFieldAdapter
- Overrides:
setShort
in classDefaultFieldAdapter
- Parameters:
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
-
setInt
public void setInt(int value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java int.- Specified by:
setInt
in interfaceFieldAdapter
- Overrides:
setInt
in classDefaultFieldAdapter
- Parameters:
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
-
setLong
public void setLong(long value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java long.- Specified by:
setLong
in interfaceFieldAdapter
- Overrides:
setLong
in classDefaultFieldAdapter
- Parameters:
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
-
setFloat
public void setFloat(float value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java float.- Specified by:
setFloat
in interfaceFieldAdapter
- Overrides:
setFloat
in classDefaultFieldAdapter
- Parameters:
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
-
setDouble
public void setDouble(double value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java double.- Specified by:
setDouble
in interfaceFieldAdapter
- Overrides:
setDouble
in classDefaultFieldAdapter
- Parameters:
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
-
setBigInteger
public void setBigInteger(java.math.BigInteger value, int offset, int length, java.nio.ByteBuffer buffer, boolean isRightJustified)
Description copied from interface:FieldAdapter
Sets the field value as a Java BigInteger.- Specified by:
setBigInteger
in interfaceFieldAdapter
- Overrides:
setBigInteger
in classDefaultFieldAdapter
- Parameters:
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
-
-