com.latencybusters.lbm.sdm
Class LBMSDMRawDouble

java.lang.Object
  extended by com.latencybusters.lbm.sdm.LBMSDM
      extended by com.latencybusters.lbm.sdm.LBMSDMRaw
          extended by com.latencybusters.lbm.sdm.LBMSDMRawDouble

public class LBMSDMRawDouble
extends LBMSDMRaw

An LBMSDMRawDouble is a helper class to minimise the effort of formatting and parsing Doubles


Field Summary
static int length
          The length of a raw double
 
Fields inherited from class com.latencybusters.lbm.sdm.LBMSDM
DEBUG_BASIC, debug_level, DEBUG_VERBOSE_PARSING
 
Constructor Summary
LBMSDMRawDouble()
          Create a raw double object, setting the value to 0
LBMSDMRawDouble(double v)
          Create a raw double object providing the value
 
Method Summary
 int format(byte[] buf, int offset)
          Format the raw double value into a byte buffer
static int format(byte[] buf, int offset, double v)
          Format a double value into a byte buffer
static double parse_s(byte[] buf, int offset)
          Parse the raw double value from a byte buffer
 int parse(byte[] buf, int offset)
          Parse the raw double value from a byte buffer The value is stored in the object.
 void set(double v)
          Set the raw double from a double field
 double toDouble()
          Get the double value of this raw double
 java.lang.String toString()
          Get a string representing the raw double value
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

length

public static int length
The length of a raw double

Constructor Detail

LBMSDMRawDouble

public LBMSDMRawDouble()
                throws LBMSDMException
Create a raw double object, setting the value to 0

Throws:
LBMSDMException

LBMSDMRawDouble

public LBMSDMRawDouble(double v)
                throws LBMSDMException
Create a raw double object providing the value

Parameters:
v - The value of the raw double
Throws:
LBMSDMException
Method Detail

set

public void set(double v)
         throws LBMSDMException
Set the raw double from a double field

Parameters:
v - The value the raw double needs to be set to
Throws:
LBMSDMException

format

public static int format(byte[] buf,
                         int offset,
                         double v)
                  throws LBMSDMException
Format a double value into a byte buffer

Parameters:
buf - The buffer to contain the formatted value
offset - The offset in to the buffer to start formatting
v - The value of the double to be formatted
Returns:
The offset after formatting the double
Throws:
LBMSDMException

format

public int format(byte[] buf,
                  int offset)
           throws LBMSDMException
Format the raw double value into a byte buffer

Parameters:
buf - The buffer to contain the formatted value
offset - The offset in to the buffer to start formatting
Returns:
The offset after formatting this object
Throws:
LBMSDMException

toString

public java.lang.String toString()
Get a string representing the raw double value

Overrides:
toString in class java.lang.Object
Returns:
A string representing the raw double value

parse_s

public static double parse_s(byte[] buf,
                             int offset)
                      throws LBMSDMException
Parse the raw double value from a byte buffer

Parameters:
buf - The buffer that contains the formatted value
offset - The offset in to the buffer to start parsing
Returns:
The double value parsed
Throws:
LBMSDMException

parse

public int parse(byte[] buf,
                 int offset)
          throws LBMSDMException
Parse the raw double value from a byte buffer The value is stored in the object.

Parameters:
buf - The buffer that contains the formatted value
offset - The offset in to the buffer to start parsing
Returns:
the new offset after parsing the field
Throws:
LBMSDMException

toDouble

public double toDouble()
Get the double value of this raw double

Returns:
The double value of this object


All of the documentation and software included in this and any other Informatica Inc "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with 29West Inc. Copyright © 2004-2014, Informatica, Inc. All Rights Reserved.