|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.latencybusters.lbm.sdm.LBMSDM
com.latencybusters.lbm.sdm.LBMSDMRaw
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp
public class LBMSDMRawTimestamp
An LBMSDMRawTimestamp is a helper class to minimise the effort of formatting and parsing Timestamps. A Timestamp is the number of seconds and microseconds since Unix epoch
Field Summary | |
---|---|
static int |
length
The number of bytes needed to store a raw LBMSDMRawTimestamp |
Fields inherited from class com.latencybusters.lbm.sdm.LBMSDM |
---|
DEBUG_BASIC, debug_level, DEBUG_VERBOSE_PARSING |
Constructor Summary | |
---|---|
LBMSDMRawTimestamp()
Create a raw timestamp field, defaulting to 0 |
|
LBMSDMRawTimestamp(long s,
long m)
Set a raw timestamp field providing the seconds and microseconds since UNIX epoch |
|
LBMSDMRawTimestamp(java.lang.String s)
Set a raw timestamp field providing a string formatted timestamp |
Method Summary | |
---|---|
LBMSDMRawTimestamp |
clone()
Get a copy of this object |
int |
format(byte[] buf,
int offset)
Format the raw timestamp value into a byte buffer |
long |
get_sec()
Get the number of seconds since epoch |
long |
get_usec()
Get the number of microseconds since the start of the current second |
int |
parse(byte[] buf,
int offset)
Parse the raw timestamp value from a byte buffer |
void |
set(long s,
long m)
Set a uint32 field providing the value as a long |
java.lang.String |
toString()
Get a string version of a timestamp |
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 |
---|
public static int length
Constructor Detail |
---|
public LBMSDMRawTimestamp() throws LBMSDMException
LBMSDMException
public LBMSDMRawTimestamp(long s, long m) throws LBMSDMException
s
- The number of seconds since epochm
- The number of microseconds since epoch
LBMSDMUnsignedException
- if an unsigned value is passed in
LBMSDMException
public LBMSDMRawTimestamp(java.lang.String s) throws LBMSDMException
s
- The string containing the time ("sec.micro" or "now")
LBMSDMUnsignedException
- if an unsigned value is passed in
LBMSDMException
Method Detail |
---|
public void set(long s, long m) throws LBMSDMException
s
- The number of seconds since epochm
- The number of microseconds since epoch
LBMSDMUnsignedException
- if an unsigned value is passed in
LBMSDMException
public long get_sec() throws LBMSDMException
LBMSDMException
public long get_usec() throws LBMSDMException
LBMSDMException
public java.lang.String toString()
toString
in class java.lang.Object
public int format(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer to contain the formatted valueoffset
- The offset in to the buffer to start formatting
LBMSDMException
public int parse(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer that contains the formatted valueoffset
- The offset in to the buffer to start parsing
LBMSDMException
public LBMSDMRawTimestamp clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |