com.latencybusters.lbm.sdm
Class LBMSDMRawUint64

java.lang.Object
  extended by com.latencybusters.lbm.sdm.LBMSDM
      extended by com.latencybusters.lbm.sdm.LBMSDMRaw
          extended by com.latencybusters.lbm.sdm.LBMSDMRawUint64
All Implemented Interfaces:
java.lang.Cloneable

public class LBMSDMRawUint64
extends LBMSDMRaw
implements java.lang.Cloneable

An LBMSDMRawUint64 is a helper class to minimise the effort of formatting and parsing unsigned 64 bit integers


Field Summary
static int length
          The number of bytes needed to store a raw LBMSDMRawUint64
 
Fields inherited from class com.latencybusters.lbm.sdm.LBMSDM
DEBUG_BASIC, debug_level, DEBUG_VERBOSE_PARSING
 
Constructor Summary
LBMSDMRawUint64()
          Create a raw uint64 field, defaulting to 0
LBMSDMRawUint64(java.math.BigInteger v)
          Create a raw uint64 field providing the value as a BigInteger
 
Method Summary
 LBMSDMRawUint64 clone()
          Get a copy of this object
 int compareTo(java.math.BigInteger bi)
          Compare to another BigInteger
 int format(byte[] buf, int offset)
          Format the raw uint64 value into a byte buffer
static int format(byte[] buf, int offset, java.math.BigInteger v)
          Format an uint64 value into a byte buffer
 java.math.BigInteger get()
          Get a raw uint64 field as a BigInteger
static java.math.BigInteger parse_s(byte[] buf, int offset)
          Parse the raw uint64 value from a byte buffer
 int parse(byte[] buf, int offset)
          Parse the raw uint64 value from a byte buffer in to the object
 void set(java.math.BigInteger v)
          Set a raw uint64 field providing the value as a BigInteger
 java.math.BigInteger toBigInteger()
          Get the long representation of the uint64
 java.lang.String toString()
          Get a string version of an uint64
 
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

length

public static int length
The number of bytes needed to store a raw LBMSDMRawUint64

Constructor Detail

LBMSDMRawUint64

public LBMSDMRawUint64()
                throws LBMSDMException
Create a raw uint64 field, defaulting to 0

Throws:
LBMSDMException

LBMSDMRawUint64

public LBMSDMRawUint64(java.math.BigInteger v)
                throws LBMSDMException
Create a raw uint64 field providing the value as a BigInteger

Parameters:
v - The BigInteger to seed this raw object
Throws:
LBMSDMException
Method Detail

set

public void set(java.math.BigInteger v)
Set a raw uint64 field providing the value as a BigInteger

Parameters:
v - The BigInteger this raw object is to use

get

public java.math.BigInteger get()
                         throws LBMSDMException
Get a raw uint64 field as a BigInteger

Returns:
A copy of the BigInteger this object has
Throws:
LBMSDMException

format

public static int format(byte[] buf,
                         int offset,
                         java.math.BigInteger v)
                  throws LBMSDMException
Format an uint64 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 uint64 to be formatted as a long
Returns:
The offset after formatting the BigInteger
Throws:
LBMSDMException

format

public int format(byte[] buf,
                  int offset)
           throws LBMSDMException
Format the raw uint64 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 version of an uint64

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the uint64

parse_s

public static java.math.BigInteger parse_s(byte[] buf,
                                           int offset)
                                    throws LBMSDMException
Parse the raw uint64 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 uint64 value parsed as a long
Throws:
LBMSDMException

parse

public int parse(byte[] buf,
                 int offset)
          throws LBMSDMException
Parse the raw uint64 value from a byte buffer in to 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

toBigInteger

public java.math.BigInteger toBigInteger()
Get the long representation of the uint64

Returns:
A long with the value of the object

compareTo

public int compareTo(java.math.BigInteger bi)
Compare to another BigInteger

Parameters:
bi - The BigInteger to be compared to
Returns:
0 if equal, negative if less than, positive if greater than

clone

public LBMSDMRawUint64 clone()
                      throws java.lang.CloneNotSupportedException
Get a copy of this object

Overrides:
clone in class java.lang.Object
Returns:
A copy of the uint64
Throws:
java.lang.CloneNotSupportedException


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.