UM Java API  6.16
com.latencybusters.lbm.sdm.LBMSDMRawDecimal Class Reference
Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMRawDecimal:
com.latencybusters.lbm.sdm.LBMSDMRaw com.latencybusters.lbm.sdm.LBMSDM

Public Member Functions

 LBMSDMRawDecimal ()
 
 LBMSDMRawDecimal (long mant_upper, int e)
 
 LBMSDMRawDecimal (String s) throws LBMSDMException
 
String toString ()
 
int format (byte[] buf, int offset) throws LBMSDMException
 
int parse (byte[] buf, int offset) throws LBMSDMException
 
LBMSDMRawDecimal clone () throws CloneNotSupportedException
 
long mantissa ()
 
int exponent ()
 
String toDbgString ()
 
void set_debug_level (int level)
 
void log (String s)
 

Static Public Attributes

static int length = LBMSDMRawInt64.length + 1
 
static final int DEBUG_BASIC = 1
 
static final int DEBUG_VERBOSE_PARSING = 2
 

Protected Attributes

int debug_level = 0
 

Detailed Description

An LBMSDMRawDecimal is a helper class to minimise the effort of formatting and parsing Decimals

Constructor & Destructor Documentation

com.latencybusters.lbm.sdm.LBMSDMRawDecimal.LBMSDMRawDecimal ( )

Create a raw decimal object defaulting to 0e0

com.latencybusters.lbm.sdm.LBMSDMRawDecimal.LBMSDMRawDecimal ( long  mant_upper,
int  e 
)

Create a raw decimal providing the mantissa and exponent

Parameters
mant_upperThe mantissa
eThe exponent
com.latencybusters.lbm.sdm.LBMSDMRawDecimal.LBMSDMRawDecimal ( String  s) throws LBMSDMException

Create a raw decimal from a string

Parameters
sThe string formatted "MMMeEE" or "mmmEee"

Member Function Documentation

int com.latencybusters.lbm.sdm.LBMSDMRawDecimal.exponent ( )

Get the exponent of the decimal number

Returns
The exponent of the decimal number

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.parse().

int com.latencybusters.lbm.sdm.LBMSDMRawDecimal.format ( byte []  buf,
int  offset 
) throws LBMSDMException

Format into a byte buffer this field.

Parameters
bufThe buffer to format the message in to
offsetThe offset in to the byte buffer where the message should be placed
Returns
The new offset in the buffer after formatting the message name
Exceptions
LBMSDMExceptionwhen an unexpected error occurs within LBMSDM

References com.latencybusters.lbm.sdm.LBMSDMRawInt64.format().

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.format(), and com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.format().

long com.latencybusters.lbm.sdm.LBMSDMRawDecimal.mantissa ( )

Get the mantissa of the decimal number

Returns
The mantissa of the decimal number

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.parse().

int com.latencybusters.lbm.sdm.LBMSDMRawDecimal.parse ( byte []  buf,
int  offset 
) throws LBMSDMException

Parse a byte buffer containing a raw decimal field (as received on a socket) The byte buffer must be in network order

Parameters
bufThe byte array (buffer) containing the raw decimal to be parsed
offsetThe index in the array where parsing should start
Returns
the new offset after parsing the field
Exceptions
LBMSDMExceptionif a problem occurs parsing the message buffer, for example if the message has bad data

References com.latencybusters.lbm.sdm.LBMSDMRawDecimal.length, com.latencybusters.lbm.sdm.LBMSDMRawInt64.parse(), and com.latencybusters.lbm.sdm.LBMSDMRawInt64.toLong().

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.parse().

void com.latencybusters.lbm.sdm.LBMSDM.set_debug_level ( int  level)
inherited

Set the debug level for processing this SDM message. Currently all debugs go to standard out.

String com.latencybusters.lbm.sdm.LBMSDMRaw.toDbgString ( )
inherited

Get a debug string for this object. This is not expected to be called and exists for child classes.

Returns
returns null - derived classes override with their value

Referenced by com.latencybusters.lbm.sdm.LBMSDMBadRawObjectException.LBMSDMBadRawObjectException().

String com.latencybusters.lbm.sdm.LBMSDMRawDecimal.toString ( )

Create a string representing a raw decimal

Returns
A string in the format "MMMeEE"

Member Data Documentation

final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_BASIC = 1
staticinherited

Debug flag for basic debug output

int com.latencybusters.lbm.sdm.LBMSDM.debug_level = 0
protectedinherited
final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_VERBOSE_PARSING = 2
staticinherited

Debug flag for verbose message parsing output


The documentation for this class was generated from the following file: