Package gov.nasa.pds.objectAccess.table
Interface FieldAdapter
- All Known Implementing Classes:
- BitFieldAdapter,- DefaultFieldAdapter,- DoubleBinaryFieldAdapter,- FloatBinaryFieldAdapter,- IntegerBinaryFieldAdapter,- NumericTextFieldAdapter
public interface FieldAdapter
Defines an adapter object for table fields that can
 read the field value from a byte array or write the
 field value into a byte array. Also has methods for
 formatting the value into an output writer for either
 delimited or fixed-width output. Methods not appropriate
 for the field type will throw 
UnsupportedOperationException.- 
Method SummaryModifier and Type Method Description BigIntegergetBigInteger(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java BigInteger.bytegetByte(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java byte.doublegetDouble(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java double.floatgetFloat(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java float.intgetInt(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java int.longgetLong(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java long.shortgetShort(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java short.StringgetString(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java string, using the US-ASCII character set to convert from bytes to characters.StringgetString(byte[] buf, int offset, int length, int startBit, int stopBit, Charset charset)Gets the field value as a Java string, using a specified character set to convert from bytes to characters.voidsetBigInteger(BigInteger value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java BigInteger.voidsetByte(byte value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java byte.voidsetDouble(double value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java double.voidsetFloat(float value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java float.voidsetInt(int value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java int.voidsetLong(long value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java long.voidsetShort(short value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java short.voidsetString(String value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java string.voidsetString(String value, int offset, int length, ByteBuffer buffer, boolean isRightJustified, Charset charset)Sets the field value as a Java string, using a specified character set to convert from characters to bytes.
- 
Method Details- 
getBytebyte getByte(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java byte.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a short
 
- 
getShortshort getShort(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java short.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a short
 
- 
getIntint getInt(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java int.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as an int
 
- 
getLonglong getLong(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java long.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a long
 
- 
getBigIntegerGets the field value as a Java BigInteger.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a BigInteger
 
- 
getFloatfloat getFloat(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java float.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a float
 
- 
getDoubledouble getDouble(byte[] buf, int offset, int length, int startBit, int stopBit)Gets the field value as a Java double.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a double
 
- 
getStringGets the field value as a Java string, using the US-ASCII character set to convert from bytes to characters.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- Returns:
- the field value, as a string
 
- 
getStringGets the field value as a Java string, using a specified character set to convert from bytes to characters.- Parameters:
- buf- the byte array containing the field
- offset- the field offset
- length- the length of the field data
- startBit- the start bit, for bit fields
- stopBit- the stop bit, for bit fields
- charset- the character set to use when converting bytes to characters
- Returns:
- the field value, as a string
 
- 
setStringSets the field value as a Java string.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setStringvoid setString(String value, int offset, int length, ByteBuffer buffer, boolean isRightJustified, Charset charset)Sets the field value as a Java string, using a specified character set to convert from characters to bytes.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
- charset- the character set to use when converting the string to bytes
 
- 
setIntSets the field value as a Java int.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setDoubleSets the field value as a Java double.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setFloatSets the field value as a Java float.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setShortSets the field value as a Java short.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setByteSets the field value as a Java byte.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setLongSets the field value as a Java long.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
- 
setBigIntegervoid setBigInteger(BigInteger value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)Sets the field value as a Java BigInteger.- Parameters:
- value- the field value
- offset- the field offset
- length- the length of the value
- buffer- the byte buffer into which to set the value
- isRightJustified- true, if the string value should be right-justified
 
 
-