UM .NET API  6.16.1
com.latencybusters.lbm.sdm.LBMSDMRawDecimal Class Reference

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

Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMRawDecimal:
com.latencybusters.lbm.sdm.LBMSDMRaw com.latencybusters.lbm.sdm.LBMSDM

Public Member Functions

 LBMSDMRawDecimal ()
 Create a raw decimal object defaulting to 0e0.
 
 LBMSDMRawDecimal (long mant_upper, int e)
 Create a raw decimal providing the mantissa and exponent. More...
 
 LBMSDMRawDecimal (System.String s)
 Create a raw decimal from a string. More...
 
override System.String ToString ()
 Create a string representing a raw decimal. More...
 
virtual int format (byte[] buf, int offset)
 Format into a byte buffer this field. More...
 
virtual 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. More...
 
virtual new System.Object Clone ()
 Get a copy of a raw decimal. More...
 
virtual long mantissa ()
 Get the mantissa of the decimal number. More...
 
virtual int exponent ()
 Get the exponent of the decimal number. More...
 
virtual System.String toDbgString ()
 Get a debug string for this object. This is not expected to be called and exists for child classes. More...
 
virtual void set_debug_level (int level)
 Set the debug level for processing this SDM message. Currently all debugs go to standard out. More...
 
virtual void log (System.String s)
 Log an event. If debug level is set greater than 0, output to stderr. More...
 

Public Attributes

const int DEBUG_BASIC = 1
 Debug flag for basic debug output.
 
const int DEBUG_VERBOSE_PARSING = 2
 Debug flag for verbose message parsing output.
 

Static Public Attributes

static int length
 The number of bytes needed to store a raw LBMSDMRawDecimal.
 

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 ( 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 ( System.String  s)

Create a raw decimal from a string.

Parameters
sThe string formatted "MMMeEE" or "mmmEee"

Member Function Documentation

virtual new System.Object com.latencybusters.lbm.sdm.LBMSDMRawDecimal.Clone ( )
virtual
virtual int com.latencybusters.lbm.sdm.LBMSDMRawDecimal.exponent ( )
virtual

Get the exponent of the decimal number.

Returns
The exponent of the decimal number

References com.latencybusters.lbm.sdm.LBMSDMRawInt64.length.

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

Format into a byte buffer this field.

LBMSDMException when an unexpected error occurs within LBMSDM

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

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

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

virtual void com.latencybusters.lbm.sdm.LBMSDM.log ( System.String  s)
virtualinherited

Log an event. If debug level is set greater than 0, output to stderr.

Parameters
sString containing the event to log
virtual long com.latencybusters.lbm.sdm.LBMSDMRawDecimal.mantissa ( )
virtual

Get the mantissa of the decimal number.

Returns
The mantissa of the decimal number
virtual int com.latencybusters.lbm.sdm.LBMSDMRawDecimal.parse ( byte[]  buf,
int  offset 
)
virtual

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

for example if the message has bad data

LBMSDMException if a problem occurs parsing the message buffer,

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

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

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

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

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

Parameters
levelDebug level to set
virtual System.String com.latencybusters.lbm.sdm.LBMSDMRaw.toDbgString ( )
virtualinherited

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().

override System.String com.latencybusters.lbm.sdm.LBMSDMRawDecimal.ToString ( )

Create a string representing a raw decimal.

Returns
A string in the format "MMMeEE"

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