|
|||||||||
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
public class LBMSDMField
LBMSDMField is the base class for all LBM SDM field types. All base LBM SDM field types use the naming convention LBMSDMField(Type). Field arrays are subclasses of the respective field class and use the naming convention LBMSDMArray(Type). LBMSDMRaw(BaseType) is used as the naming convention for raw data types where needed and support the respective LBMSDMField(Type) classes.
Field Summary | |
---|---|
protected int |
elements
Number of elements in array |
static int |
MAX_FIELD_NAME_LENGTH
Maximum length of a field name. |
protected java.lang.String |
name
The name of this field |
protected short |
type
The current field type |
static short |
TYPE_ARRAY_BLOB
SDM field type: Array of Binary Large Objects (BLOB). |
static short |
TYPE_ARRAY_BOOLEAN
SDM field type: Array of Booleans (non-zero is true; zero is false). |
static short |
TYPE_ARRAY_DECIMAL
SDM field type: Array of decimal numbers. |
static short |
TYPE_ARRAY_DOUBLE
SDM field type: Array of double-precision floating points. |
static short |
TYPE_ARRAY_FLOAT
SDM field type: Array of single-precision floating points. |
static short |
TYPE_ARRAY_INT16
SDM field type: Array of 16-bit signed integers. |
static short |
TYPE_ARRAY_INT32
SDM field type: Array of 32-bit signed integers. |
static short |
TYPE_ARRAY_INT64
SDM field type: Array of 64-bit signed integers. |
static short |
TYPE_ARRAY_INT8
SDM field type: Array of 8-bit signed integers. |
static short |
TYPE_ARRAY_MESSAGE
SDM field type: Array of nested SDM messages. |
static short |
TYPE_ARRAY_STRING
SDM field type: Array of character strings (ASCIZ). |
static short |
TYPE_ARRAY_TIMESTAMP
SDM field type: Array of timestamps (seconds and microseconds since the epoch (UTC)). |
static short |
TYPE_ARRAY_UINT16
SDM field type: Array of 16-bit unsigned integers. |
static short |
TYPE_ARRAY_UINT32
SDM field type: Array of 32-bit unsigned integers. |
static short |
TYPE_ARRAY_UINT64
SDM field type: Array of 64-bit unsigned integers. |
static short |
TYPE_ARRAY_UINT8
SDM field type: Array of 8-bit unsigned integers. |
static short |
TYPE_ARRAY_UNICODE
SDM field type: Array of unicode strings. |
static short |
TYPE_BLOB
SDM field type: Binary Large Object (BLOB). |
static short |
TYPE_BOOLEAN
SDM field type: Boolean (non-zero is true; zero is false). |
static short |
TYPE_DECIMAL
SDM field type: Decimal number. |
static short |
TYPE_DOUBLE
SDM field type: Double-precision floating point. |
static short |
TYPE_FLOAT
SDM field type: Single-precision floating point. |
static short |
TYPE_INT16
SDM field type: 16-bit signed integer. |
static short |
TYPE_INT32
SDM field type: 32-bit signed integer. |
static short |
TYPE_INT64
SDM field type: 64-bit signed integer. |
static short |
TYPE_INT8
SDM field type: 8-bit signed integer. |
static short |
TYPE_INVALID
SDM field type: Type is invalid. |
static short |
TYPE_MESSAGE
SDM field type: Nested SDM message. |
static short |
TYPE_STRING
SDM field type: Character string (ASCIZ). |
static short |
TYPE_TIMESTAMP
SDM field type: Seconds and microseconds since the epoch (UTC). |
static short |
TYPE_UINT16
SDM field type: 16-bit unsigned integer. |
static short |
TYPE_UINT32
SDM field type: 32-bit unsigned integer. |
static short |
TYPE_UINT64
SDM field type: 64-bit unsigned integer. |
static short |
TYPE_UINT8
SDM field type: 8-bit unsigned integer. |
static short |
TYPE_UNICODE
SDM field type: Unicode string. |
Fields inherited from class com.latencybusters.lbm.sdm.LBMSDM |
---|
DEBUG_BASIC, debug_level, DEBUG_VERBOSE_PARSING |
Constructor Summary | |
---|---|
|
LBMSDMField()
Create an untyped, unnamed field |
protected |
LBMSDMField(java.lang.String Name,
short Type)
Create a named field with a defined type - used by derived classes |
Method Summary | |
---|---|
void |
add_element(LBMSDMField newfield)
Add an element to an array from a field |
protected void |
append(LBMSDMField newfield)
This is overridden by array classes |
LBMSDMField |
clone()
Clone this field |
int |
format_name(byte[] buf,
int offset)
Format into a byte buffer the name of this field. |
int |
format_type(byte[] buf,
int offset)
Format into a byte buffer the type of this field. |
protected int |
format(byte[] buf,
int offset)
This is overridden by field and array subclasses |
protected int |
get_len()
This is overridden by field and array subclasses |
java.lang.String |
get_name()
Get the field name |
short |
getType()
Get the type of this field |
static short |
getType(java.lang.String typeName,
boolean isarray)
Get the TYPE_XXX value for a given string. |
java.lang.String |
getTypeString()
Get a string representing this field type |
java.lang.String |
internalString(java.lang.String sname,
java.lang.String sval)
Create a string based on the internal representation (includes the type) |
boolean |
isNull()
Test to see if this field is a null field (I.E. |
int |
length()
Return the number of elements in an array. |
int |
name_len()
Get the length of this fields name in raw form. |
protected int |
parse(byte[] buf,
int offset)
This is overridden by field and array subclasses |
void |
remove(int element)
Remove an element from an array class |
boolean |
sameBaseType(LBMSDMField f)
Compare the base type of the field to this field |
boolean |
sameType(LBMSDMField f)
Compare the type of the field to this field |
void |
set_name(java.lang.String new_name)
Set the name of this field. |
protected void |
set(LBMSDMField f,
int arrayidx)
This is overridden by array classes |
void |
setNull()
Set this field to a null value - discarding current value (if any) |
java.lang.String |
toDbgString()
Create a string useful for debugging. |
int |
type_len()
Get the length of the type field in raw form. |
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, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_FIELD_NAME_LENGTH
public static final short TYPE_INVALID
public static final short TYPE_BOOLEAN
public static final short TYPE_INT8
public static final short TYPE_UINT8
public static final short TYPE_INT16
public static final short TYPE_UINT16
public static final short TYPE_INT32
public static final short TYPE_UINT32
public static final short TYPE_INT64
public static final short TYPE_UINT64
public static final short TYPE_FLOAT
public static final short TYPE_DOUBLE
public static final short TYPE_DECIMAL
public static final short TYPE_TIMESTAMP
public static final short TYPE_MESSAGE
public static final short TYPE_STRING
public static final short TYPE_UNICODE
public static final short TYPE_BLOB
public static final short TYPE_ARRAY_BOOLEAN
public static final short TYPE_ARRAY_INT8
public static final short TYPE_ARRAY_UINT8
public static final short TYPE_ARRAY_INT16
public static final short TYPE_ARRAY_UINT16
public static final short TYPE_ARRAY_INT32
public static final short TYPE_ARRAY_UINT32
public static final short TYPE_ARRAY_INT64
public static final short TYPE_ARRAY_UINT64
public static final short TYPE_ARRAY_FLOAT
public static final short TYPE_ARRAY_DOUBLE
public static final short TYPE_ARRAY_DECIMAL
public static final short TYPE_ARRAY_TIMESTAMP
public static final short TYPE_ARRAY_MESSAGE
public static final short TYPE_ARRAY_STRING
public static final short TYPE_ARRAY_UNICODE
public static final short TYPE_ARRAY_BLOB
protected short type
protected java.lang.String name
protected int elements
Constructor Detail |
---|
public LBMSDMField()
protected LBMSDMField(java.lang.String Name, short Type) throws java.lang.IllegalArgumentException
Name
- Name of the field to be created.Type
- Type of the field to be created.
java.lang.IllegalArgumentException
Method Detail |
---|
public static short getType(java.lang.String typeName, boolean isarray)
typeName
- A string which needs translating to a short formisarray
- A boolean indicating if an array type is required
public short getType()
public java.lang.String getTypeString()
public boolean sameType(LBMSDMField f)
f
- A field to compare
public boolean sameBaseType(LBMSDMField f)
f
- A field to compare
public java.lang.String get_name()
public void set_name(java.lang.String new_name)
new_name
- The name this field shall use.protected void set(LBMSDMField f, int arrayidx) throws LBMSDMException
f
- The array field to be modifiedarrayidx
- The array index of the field to be set
LBMSDMException
public void add_element(LBMSDMField newfield) throws LBMSDMException
newfield
- The new field to be added
LBMSDMException
protected void append(LBMSDMField newfield) throws LBMSDMException
newfield
- The new field to be appended
LBMSDMException
- when a non array field tries to call append()public java.lang.String toDbgString()
public java.lang.String internalString(java.lang.String sname, java.lang.String sval)
sname
- The field namesval
- The field value in string form
protected int get_len()
public int name_len()
public int type_len()
protected int format(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer to format the message in tooffset
- The offset in to the byte buffer
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic int format_name(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer to format the message in tooffset
- The offset in to the byte buffer where the message should be placed
LBMSDMException
- when an unexpected error occurs within LBMSDMpublic int format_type(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer to format the type in tooffset
- The offset in to the byte buffer where the type should be placed
LBMSDMException
- when an unexpected error occurs within LBMSDMprotected int parse(byte[] buf, int offset) throws LBMSDMException
buf
- The buffer to format in tooffset
- The offset in to the byte buffer
LBMSDMException
- parse() should be overriddenpublic LBMSDMField clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int length() throws LBMSDMException
LBMSDMNotArrayException
- if called for non array classes
LBMSDMException
public void remove(int element) throws LBMSDMException
element
- The array element to be removed
LBMSDMException
public boolean isNull()
public void setNull()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |