UM Java API
6.16.1
|
Public Member Functions | |
PDMDefinition (int numFields) | |
PDMDefinition (int numFields, boolean useIntsForNames) | |
List< PDMFieldInfo > | getFieldInfoList () |
int | getNumFields () |
boolean | isFinalized () |
void | setMsgVersMajor (byte msgVersMajor) |
byte | getMsgVersMajor () |
void | setMsgVersMinor (byte msgVersMinor) |
byte | getMsgVersMinor () |
void | setId (int id) |
int | getId () |
boolean | isIntsForNames () |
Iterator< PDMFieldInfo > | createFieldInfoIterator () |
void | finalizeDef () |
PDMFieldInfo | getFieldInfo (int name) |
PDMFieldInfo | getFieldInfo (String name) |
PDMFieldInfo | addFieldInfo (String name, PDMFieldType type, boolean required) |
PDMFieldInfo | addFieldInfo (int name, PDMFieldType type, boolean required) |
PDMFieldInfo | addFieldInfo (String name, PDMFieldType type, int fixedStrLen, boolean required) |
PDMFieldInfo | addFieldInfo (int name, PDMFieldType type, int fixedStrLen, boolean required) |
PDMFieldInfo | addFieldInfo (String name, PDMFieldType type, boolean required, int numElements) |
PDMFieldInfo | addFieldInfo (int name, PDMFieldType type, boolean required, int numElements) |
PDMFieldInfo | addFieldInfo (String name, PDMFieldType type, int fixedStrLen, boolean required, int numElements) |
PDMFieldInfo | addFieldInfo (int name, PDMFieldType type, int fixedStrLen, boolean required, int numElements) |
int | compareToWithVersion (int otherDefnId, int otherMsgVersMajor, int otherMsgVersMinor) |
int | compareToWithVersion (PDMDefinition other) |
int | compareTo (int otherDefnId) |
int | compareTo (PDMDefinition other) |
byte[] | toBytes (PDMSerializer ser) |
int | toBytes (PDMSerializer ser, byte[] ba, int pos) |
int | parse (PDMDeserializer deser, byte[] ba) |
int | parse (PDMDeserializer deser, byte[] ba, int pos) |
Protected Member Functions | |
PDMDefinition () | |
int | getFixedRequiredLen () |
int | calcLen (PDMSerializer ser) |
PDMFieldInfo | getFieldInfoById (int id) |
PDMFieldInfo | addFieldInfo (String strName, int intName, PDMFieldType type, int fixedStrLen, boolean required, int numElements) |
The message definition class that needs to be populated and finalized before using in a PDMMessage
|
protected |
Protected constructor used by PDMMessage when parsing a PDMDefinition included with the PDMMessage
com.latencybusters.pdm.PDMDefinition.PDMDefinition | ( | int | numFields | ) |
Creates a new definition with the specified number of fields
numFields | the number of fields |
com.latencybusters.pdm.PDMDefinition.PDMDefinition | ( | int | numFields, |
boolean | useIntsForNames | ||
) |
Creates a new definition with the specified number of fields and whether or not to use ints or strings as field names
numFields | the number of fields |
useIntsForNames | true to use ints as field names or false to use string field names (the default) |
|
protected |
The main method used internally to add field information to the definition
strName | the string name of the field (if using string names) |
intName | the int name of the field (if using int names) |
type | the type of field |
fixedStrLen | the fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode |
required | whether or not the field is required |
numElements | a non-zero value is used to define a fixed-size array for array types |
Referenced by com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | String | name, |
PDMFieldType | type, | ||
boolean | required | ||
) |
Adds field information to the definition with a string field name
name | the string name of the field |
type | the type of field |
required | whether or not the field is required |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | int | name, |
PDMFieldType | type, | ||
boolean | required | ||
) |
Adds field information to the definition with an int field name
name | the int name of the field |
type | the type of field |
required | whether or not the field is required |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | String | name, |
PDMFieldType | type, | ||
int | fixedStrLen, | ||
boolean | required | ||
) |
Adds field information to the definition for a fixed length string field with a string field name
name | the string name of the field |
type | the type of field |
fixedStrLen | the fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode |
required | whether or not the field is required |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | int | name, |
PDMFieldType | type, | ||
int | fixedStrLen, | ||
boolean | required | ||
) |
Adds field information to the definition for a fixed length string field with an int field name
name | the int name of the field |
type | the type of field |
fixedStrLen | the fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode |
required | whether or not the field is required |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | String | name, |
PDMFieldType | type, | ||
boolean | required, | ||
int | numElements | ||
) |
Adds field information to the definition for a fixed-size array field with a string field name
name | the string name of the field |
type | the type of field |
required | whether or not the field is required |
numElements | a non-zero value is used to define a fixed-size array for array types |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | int | name, |
PDMFieldType | type, | ||
boolean | required, | ||
int | numElements | ||
) |
Adds field information to the definition for a fixed-size array field with an int field name
name | the int name of the field |
type | the type of field |
required | whether or not the field is required |
numElements | a non-zero value is used to define a fixed-size array for array types |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | String | name, |
PDMFieldType | type, | ||
int | fixedStrLen, | ||
boolean | required, | ||
int | numElements | ||
) |
Adds field information to the definition for a fixed-size array field of fixed length strings with a string field name
name | the string name of the field |
type | the type of field |
fixedStrLen | the fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode |
required | whether or not the field is required |
numElements | a non-zero value is used to define a fixed-size array for array types |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | int | name, |
PDMFieldType | type, | ||
int | fixedStrLen, | ||
boolean | required, | ||
int | numElements | ||
) |
Adds field information to the definition for a fixed-size array field of fixed length strings with an int field name
name | the int name of the field |
type | the type of field |
fixedStrLen | the fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode |
required | whether or not the field is required |
numElements | a non-zero value is used to define a fixed-size array for array types |
References com.latencybusters.pdm.PDMDefinition.addFieldInfo().
|
protected |
Calculates the total length of the definition
ser |
References com.latencybusters.pdm.PDMFieldInfo.toBytes().
Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen(), and com.latencybusters.pdm.PDMDefinition.toBytes().
int com.latencybusters.pdm.PDMDefinition.compareTo | ( | int | otherDefnId | ) |
Used to compare this PDMDefinition to another's id taking into account only the the definition id
otherDefnId | the other definition id to compare against |
Referenced by com.latencybusters.pdm.PDMDefinition.compareToWithVersion(), and com.latencybusters.pdm.PDMMessage.getMessageLen().
int com.latencybusters.pdm.PDMDefinition.compareTo | ( | PDMDefinition | other | ) |
Used to compare this PDMDefinition to another taking into account only the the definition id
other | the other PDMDefinition to compare against |
int com.latencybusters.pdm.PDMDefinition.compareToWithVersion | ( | int | otherDefnId, |
int | otherMsgVersMajor, | ||
int | otherMsgVersMinor | ||
) |
Used to compare this PDMDefinition to another's properties taking into account the definition id and the major and minor message version
otherDefnId | the other definition id to compare against |
otherMsgVersMajor | the other definition major version to compare against |
otherMsgVersMinor | the other definition minor version to compare against |
References com.latencybusters.pdm.PDMDefinition.compareTo().
Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().
int com.latencybusters.pdm.PDMDefinition.compareToWithVersion | ( | PDMDefinition | other | ) |
Used to compare this PDMDefinition to another taking into account the definition id and the major and minor message version
other | the other PDMDefinition to compare against |
References com.latencybusters.pdm.PDMDefinition.compareTo().
Iterator<PDMFieldInfo> com.latencybusters.pdm.PDMDefinition.createFieldInfoIterator | ( | ) |
Creates an iterator of PDMFieldInfo to iterate through the field information
void com.latencybusters.pdm.PDMDefinition.finalizeDef | ( | ) |
Finalizes the definition to ready it for use in a message
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.getFieldInfo | ( | int | name | ) |
Access the field information by integer name
name | the int field name |
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.getFieldInfo | ( | String | name | ) |
Access the field information by String name
name | the string field name |
|
protected |
Gets the PDMFieldInfo object by its id
id | the internal id of the field |
Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().
|
protected |
Gets or calcs the length of the fixed required fields
Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().
int com.latencybusters.pdm.PDMDefinition.parse | ( | PDMDeserializer | deser, |
byte[] | ba | ||
) |
Parses an existing byte array into this object
deser | the PDMDeserializer to use |
ba | the byte array to parse |
Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().
int com.latencybusters.pdm.PDMDefinition.parse | ( | PDMDeserializer | deser, |
byte[] | ba, | ||
int | pos | ||
) |
Parses an existing byte array into this object
deser | the PDMDeserializer to use |
ba | the byte array to parse |
pos | the position to start parsing in the byte array |
References com.latencybusters.pdm.PDMFieldInfo.parse(), com.latencybusters.pdm.PDMDeserializer.readBoolean(), com.latencybusters.pdm.PDMDeserializer.readByte(), and com.latencybusters.pdm.PDMDeserializer.readInt().
byte [] com.latencybusters.pdm.PDMDefinition.toBytes | ( | PDMSerializer | ser | ) |
Serializes the PDMDefinition to a new byte array
ser | the PDMSerializer to use |
References com.latencybusters.pdm.PDMDefinition.calcLen().
Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().
int com.latencybusters.pdm.PDMDefinition.toBytes | ( | PDMSerializer | ser, |
byte[] | ba, | ||
int | pos | ||
) |
Serialize the PDMDefinition to an existing byte array
ser | the PDMSerializer to use |
ba | the byte array to serialize into |
pos | the position to start at in the byte array |
References com.latencybusters.pdm.PDMFieldInfo.toBytes(), com.latencybusters.pdm.PDMSerializer.writeBoolean(), com.latencybusters.pdm.PDMSerializer.writeByte(), and com.latencybusters.pdm.PDMSerializer.writeInt().