UM Java API 6.17.1

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | List of all members
com.latencybusters.pdm.PDMDefinition Class Reference

## 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)

## Detailed Description

The message definition class that needs to be populated and finalized before using in a PDMMessage

Author
  jfugitt

## Constructor & Destructor Documentation

com.latencybusters.pdm.PDMDefinition.PDMDefinition | ( |  | ) |
| 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

Parameters

  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

Parameters

  numFields | the number of fields
  useIntsForNames | true to use ints as field names or false to use string field names (the default)

## Member Function Documentation

PDMFieldInfo com.latencybusters.pdm.PDMDefinition.addFieldInfo | ( | String | strName,
|  | int | intName,
|  | PDMFieldType | type,
|  | int | fixedStrLen,
|  | boolean | required,
|  | int | numElements
| ) |  |
| protected

The main method used internally to add field information to the definition

Parameters

  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

Returns
  the added PDMFieldInfo

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

Parameters

  name | the string name of the field
  type | the type of field
  required | whether or not the field is required

Returns
  the PDMFieldInfo handle

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

Parameters

  name | the int name of the field
  type | the type of field
  required | whether or not the field is required

Returns
  the PDMFieldInfo handle

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

Parameters

  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

Returns
  the PDMFieldInfo handle

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

Parameters

  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

Returns
  the PDMFieldInfo handle

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

Parameters

  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

Returns
  the PDMFieldInfo handle

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

Parameters

  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

Returns
  the PDMFieldInfo handle

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

Parameters

  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

Returns
  the PDMFieldInfo handle

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

Parameters

  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

Returns
  the PDMFieldInfo handle

References com.latencybusters.pdm.PDMDefinition.addFieldInfo().

int com.latencybusters.pdm.PDMDefinition.calcLen | ( | PDMSerializer | ser | ) |
| protected

Calculates the total length of the definition

Parameters

  ser |

Returns
  the length in bytes

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

Parameters

  otherDefnId | the other definition id to compare against

Returns
  0 if the two are equal, 1 if this PDMDefinition is greater, -1 if this PDMDefinition is less

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

Parameters

  other | the other PDMDefinition to compare against

Returns
  0 if the two are equal, 1 if this PDMDefinition is greater, -1 if this PDMDefinition is less

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

Parameters

  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

Returns
  0 if the two are equal, 1 if this PDMDefinition is greater, -1 if this PDMDefinition is less

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

Parameters

  other | the other PDMDefinition to compare against

Returns
  0 if the two are equal, 1 if this PDMDefinition is greater, -1 if this PDMDefinition is less

References com.latencybusters.pdm.PDMDefinition.compareTo().

Iterator<PDMFieldInfo> com.latencybusters.pdm.PDMDefinition.createFieldInfoIterator | ( |  | ) |

Creates an iterator of PDMFieldInfo to iterate through the field information

Returns
  an Iterator used to iterate through the list of PDMFieldInfo

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

Parameters

  name | the int field name

Returns
  the PDMFieldInfo handle

PDMFieldInfo com.latencybusters.pdm.PDMDefinition.getFieldInfo | ( | String | name | ) |

Access the field information by String name

Parameters

  name | the string field name

Returns
  the PDMFieldInfo handle

PDMFieldInfo com.latencybusters.pdm.PDMDefinition.getFieldInfoById | ( | int | id | ) |
| protected

Gets the PDMFieldInfo object by its id

Parameters

  id | the internal id of the field

Returns
  the PDMFieldInfo object

Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().

int com.latencybusters.pdm.PDMDefinition.getFixedRequiredLen | ( |  | ) |
| protected

Gets or calcs the length of the fixed required fields

Returns
  the length in bytes

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

Parameters

  deser | the PDMDeserializer to use
  ba | the byte array to parse

Returns
  the updated position after parsing this object

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

Parameters

  deser | the PDMDeserializer to use
  ba | the byte array to parse
  pos | the position to start parsing in the byte array

Returns
  the updated position after parsing this object

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

Parameters

  ser | the PDMSerializer to use

Returns
  the new byte array

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

Parameters

  ser | the PDMSerializer to use
  ba | the byte array to serialize into
  pos | the position to start at in the byte array

Returns
  the updated position after serializing this object

References com.latencybusters.pdm.PDMFieldInfo.toBytes(), com.latencybusters.pdm.PDMSerializer.writeBoolean(), com.latencybusters.pdm.PDMSerializer.writeByte(), and com.latencybusters.pdm.PDMSerializer.writeInt().

The documentation for this class was generated from the following file:

- PDMDefinition.java