|
|||||||||
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.LBMSDMField
com.latencybusters.lbm.sdm.LBMSDMFieldString
public class LBMSDMFieldString
Implements an SDM Field of type String
Field Summary | |
---|---|
protected java.lang.String |
internalValue
The internal data storage for this field |
Fields inherited from class com.latencybusters.lbm.sdm.LBMSDM |
---|
DEBUG_BASIC, debug_level, DEBUG_VERBOSE_PARSING |
Constructor Summary | |
---|---|
protected |
LBMSDMFieldString(short type,
java.lang.String name)
Constructor for array subclasses |
|
LBMSDMFieldString(java.lang.String name)
Constructor for an empty string field. |
|
LBMSDMFieldString(java.lang.String name,
java.lang.String v)
Constructor for a string field with a known string |
Method Summary | |
---|---|
LBMSDMFieldString |
clone()
Get a copy of this object |
static int |
format_long(byte[] buf,
int offset,
java.lang.String arbstr)
Format a long string (greater than 255 characters) The formatted message will use a 4 byte length field to describe the string size |
static int |
format_short(byte[] buf,
int offset,
java.lang.String arbstr)
Format a short string (less than 255 characters) The formatted message will use a 1 byte length field to describe the string size |
int |
format(byte[] buf,
int offset)
Format the string as a long string The formatted message will use a 4 byte length field to describe the string size |
protected static int |
format(byte[] buf,
int offset,
java.lang.String v,
int len_size)
Format a raw string in to a byte buffer specifying the size of the length field. |
int |
get_base_len()
Get the length of formatted field This is used by the respective array class |
int |
get_len()
Get the length of formatted field |
java.lang.String |
get()
Get the raw string field |
int |
parse_name(byte[] buf,
int offset)
Parse a byte buffer and store the value as the name which is considered a short string |
int |
parse(byte[] buf,
int offset)
Parse a byte buffer and store the value as the string value which is considered a long string |
void |
set(java.lang.String v)
Set the raw string. |
java.lang.String |
toDbgString()
Get a string useful for debugging |
java.lang.String |
toString()
Get the string |
Methods inherited from class com.latencybusters.lbm.sdm.LBMSDMField |
---|
add_element, append, format_name, format_type, get_name, getType, getType, getTypeString, internalString, isNull, length, name_len, remove, sameBaseType, sameType, set_name, set, setNull, type_len |
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 |
---|
protected java.lang.String internalValue
Constructor Detail |
---|
public LBMSDMFieldString(java.lang.String name)
name
- The field namepublic LBMSDMFieldString(java.lang.String name, java.lang.String v)
name
- The field namev
- The string to be used as the field valueprotected LBMSDMFieldString(short type, java.lang.String name)
type
- The field type to be createdname
- The name of the field to be createdMethod Detail |
---|
public java.lang.String get()
public int get_len()
get_len
in class LBMSDMField
public final int get_base_len()
public void set(java.lang.String v)
v
- The LBMSDMRawBlob object to be set - it will be copiedpublic java.lang.String toDbgString()
toDbgString
in class LBMSDMField
protected static int format(byte[] buf, int offset, java.lang.String v, int len_size) throws LBMSDMException
buf
- The byte buffer to have the string formatted inoffset
- The offset to begin formatting in the bufferv
- The string to be formattedlen_size
- This specifies the size of the length field to be formatted
and should be 1 or 4
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic static int format_short(byte[] buf, int offset, java.lang.String arbstr) throws LBMSDMException
buf
- The byte buffer to have the string formatted inoffset
- The offset to begin formatting in the bufferarbstr
- The string to be formatted
LBMSDMNameTooLongException
- if the string exceeds 255 characters
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic static int format_long(byte[] buf, int offset, java.lang.String arbstr) throws LBMSDMException
buf
- The byte buffer to have the string formatted inoffset
- The offset to begin formatting in the bufferarbstr
- The string to be formatted
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic int format(byte[] buf, int offset) throws LBMSDMException
format
in class LBMSDMField
buf
- The byte buffer to have the string formatted inoffset
- The offset to begin formatting in the buffer
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic java.lang.String toString()
toString
in class java.lang.Object
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic int parse_name(byte[] buf, int offset) throws LBMSDMException
buf
- The byte buffer to be parsed for the nameoffset
- The offset to begin parsing the buffer
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic int parse(byte[] buf, int offset) throws LBMSDMException
parse
in class LBMSDMField
buf
- The byte buffer to be parsed for the string valueoffset
- The offset to begin parsing the buffer
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic LBMSDMFieldString clone() throws java.lang.CloneNotSupportedException
clone
in class LBMSDMField
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |