|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.latencybusters.lbm.sdm.LBMSDM
com.latencybusters.lbm.sdm.LBMSDMRaw
com.latencybusters.lbm.sdm.LBMSDMRawDecimal
public class LBMSDMRawDecimal
An LBMSDMRawDecimal is a helper class to minimise the effort of formatting and parsing Decimals
Field Summary | |
---|---|
static int |
length
The number of bytes needed to store a raw LBMSDMRawDecimal |
Fields inherited from class com.latencybusters.lbm.sdm.LBMSDM |
---|
DEBUG_BASIC, debug_level, DEBUG_VERBOSE_PARSING |
Constructor Summary | |
---|---|
LBMSDMRawDecimal()
Create a raw decimal object defaulting to 0e0 |
|
LBMSDMRawDecimal(long mant_upper,
int e)
Create a raw decimal providing the mantissa and exponent |
|
LBMSDMRawDecimal(java.lang.String s)
Create a raw decimal from a string |
Method Summary | |
---|---|
LBMSDMRawDecimal |
clone()
Get a copy of a raw decimal |
int |
exponent()
Get the exponent of the decimal number |
int |
format(byte[] buf,
int offset)
Format into a byte buffer this field. |
long |
mantissa()
Get the mantissa of the decimal number |
int |
parse(byte[] buf,
int offset)
Parse a byte buffer containing a raw decimal field (as received on a socket) The byte buffer must be in network order |
java.lang.String |
toString()
Create a string representing a raw decimal |
Methods inherited from class com.latencybusters.lbm.sdm.LBMSDMRaw |
---|
toDbgString |
Methods inherited from class com.latencybusters.lbm.sdm.LBMSDM |
---|
log, set_debug_level |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int length
Constructor Detail |
---|
public LBMSDMRawDecimal()
public LBMSDMRawDecimal(long mant_upper, int e)
mant_upper
- The mantissae
- The exponentpublic LBMSDMRawDecimal(java.lang.String s) throws LBMSDMException
s
- The string formatted "MMMeEE" or "mmmEee"
LBMSDMException
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int format(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer to format the message in tooffset
- The offset in to the byte buffer where the message should be placed
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic int parse(byte[] buf, int offset) throws LBMSDMException
buf
- The byte array (buffer) containing the raw decimal to be parsedoffset
- The index in the array where parsing should start
LBMSDMException
- if a problem occurs parsing the message buffer,
for example if the message has bad datapublic LBMSDMRawDecimal clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public long mantissa()
public int exponent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |