UM Java API 6.17.1

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
com.latencybusters.lbm.sdm.LBMSDMRawDecimal Class Reference
Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMRawDecimal:

## 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_upper | The mantissa
  e | The exponent

com.latencybusters.lbm.sdm.LBMSDMRawDecimal.LBMSDMRawDecimal | ( | String | s | ) | throws LBMSDMException

Create a raw decimal from a string

Parameters

  s | The string formatted "MMMeEE" or "mmmEee"

## Member Function Documentation

LBMSDMRawDecimal com.latencybusters.lbm.sdm.LBMSDMRawDecimal.clone | ( |  | ) | throws CloneNotSupportedException

Get a copy of a raw decimal

Returns
  A raw decimal object LBMSDMRawDecimal

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

Referenced by com.latencybusters.lbm.sdm.LBMSDMRawDecimal.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.LBMSDMFieldDecimal(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.set(), and com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.set().

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

  buf | The buffer to format the message in to
  offset | The 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

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

void com.latencybusters.lbm.sdm.LBMSDM.log | ( | String | s | ) |
| inherited

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

Referenced by com.latencybusters.lbm.sdm.LBMSDMFields.get_attr(), com.latencybusters.lbm.sdm.LBMSDMFields.LBMSDMFields(), com.latencybusters.lbm.sdm.LBMSDMFieldBlob.set(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.set(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.set(), com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.set(), com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.set(), and com.latencybusters.lbm.sdm.LBMSDMArrayUint64.set().

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

  buf | The byte array (buffer) containing the raw decimal to be parsed
  offset | The index in the array where parsing should start

Returns
  the new offset after parsing the field

Exceptions

  LBMSDMException | if 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
| static inherited

Debug flag for basic debug output

int com.latencybusters.lbm.sdm.LBMSDM.debug_level = 0
| protected inherited

Debug mask for SDM implementation.

See also
  set_debug_level

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data(), com.latencybusters.lbm.sdm.LBMSDMessage.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.parse(), and com.latencybusters.lbm.sdm.LBMSDMArrayMessage.parse().

final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_VERBOSE_PARSING = 2
| static inherited

Debug flag for verbose message parsing output

int com.latencybusters.lbm.sdm.LBMSDMRawDecimal.length = LBMSDMRawInt64.length + 1
| static

The number of bytes needed to store a raw LBMSDMRawDecimal

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.append(), com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.fixed_size(), com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.LBMSDMArrayDecimal(), and com.latencybusters.lbm.sdm.LBMSDMRawDecimal.parse().

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

- LBMSDMRawDecimal.java