|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.pds.objectAccess.table.IntegerBinaryFieldAdapter
public class IntegerBinaryFieldAdapter
Implements a field adapter for binary integer fields.
Constructor Summary | |
---|---|
IntegerBinaryFieldAdapter(int length,
boolean isSigned,
boolean isBigEndian)
|
Method Summary | |
---|---|
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. |
String |
getString(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. |
String |
getString(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. |
void |
setByte(byte value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java byte. |
void |
setDouble(double value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java double. |
void |
setFloat(float value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java float. |
void |
setInt(int value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java int. |
void |
setLong(long value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java long. |
void |
setShort(short value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java short. |
void |
setString(String value,
int offset,
int length,
ByteBuffer buffer,
boolean isRightJustified)
Sets the field value as a Java string. |
void |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntegerBinaryFieldAdapter(int length, boolean isSigned, boolean isBigEndian)
Method Detail |
---|
public String getString(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getString
in interface FieldAdapter
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
public String getString(byte[] buf, int offset, int length, int startBit, int stopBit, Charset charset)
FieldAdapter
getString
in interface FieldAdapter
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 fieldscharset
- the character set to use when converting bytes to characters
public byte getByte(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getByte
in interface FieldAdapter
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
public short getShort(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getShort
in interface FieldAdapter
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
public int getInt(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getInt
in interface FieldAdapter
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
public long getLong(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getLong
in interface FieldAdapter
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
public float getFloat(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getFloat
in interface FieldAdapter
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
public double getDouble(byte[] buf, int offset, int length, int startBit, int stopBit)
FieldAdapter
getDouble
in interface FieldAdapter
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
public void setString(String value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setString
in interface FieldAdapter
value
- the field valueoffset
- the field offsetpublic void setString(String value, int offset, int length, ByteBuffer buffer, boolean isRightJustified, Charset charset)
FieldAdapter
setString
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field datapublic void setByte(byte value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setByte
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field datapublic void setShort(short value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setShort
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field datapublic void setInt(int value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setInt
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field datapublic void setLong(long value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setLong
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field datapublic void setFloat(float value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setFloat
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field datapublic void setDouble(double value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
FieldAdapter
setDouble
in interface FieldAdapter
value
- the field valueoffset
- the field offsetlength
- the length of the field data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |