UM Java API  6.16.1
com.latencybusters.pdm.PDMDefinition Class Reference

Public Member Functions

 PDMDefinition (int numFields)
 
 PDMDefinition (int numFields, boolean useIntsForNames)
 
List< PDMFieldInfogetFieldInfoList ()
 
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< PDMFieldInfocreateFieldInfoIterator ()
 
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
numFieldsthe 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
numFieldsthe number of fields
useIntsForNamestrue 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
strNamethe string name of the field (if using string names)
intNamethe int name of the field (if using int names)
typethe type of field
fixedStrLenthe fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode
requiredwhether or not the field is required
numElementsa 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
namethe string name of the field
typethe type of field
requiredwhether 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
namethe int name of the field
typethe type of field
requiredwhether 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
namethe string name of the field
typethe type of field
fixedStrLenthe fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode
requiredwhether 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
namethe int name of the field
typethe type of field
fixedStrLenthe fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode
requiredwhether 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
namethe string name of the field
typethe type of field
requiredwhether or not the field is required
numElementsa 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
namethe int name of the field
typethe type of field
requiredwhether or not the field is required
numElementsa 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
namethe string name of the field
typethe type of field
fixedStrLenthe fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode
requiredwhether or not the field is required
numElementsa 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
namethe int name of the field
typethe type of field
fixedStrLenthe fixed string length (number of characters) and is normally 0 unless the type is fixed string or fixed unicode
requiredwhether or not the field is required
numElementsa 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
otherDefnIdthe 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
otherthe 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
otherDefnIdthe other definition id to compare against
otherMsgVersMajorthe other definition major version to compare against
otherMsgVersMinorthe 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
otherthe 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
namethe int field name
Returns
the PDMFieldInfo handle
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.getFieldInfo ( String  name)

Access the field information by String name

Parameters
namethe string field name
Returns
the PDMFieldInfo handle
PDMFieldInfo com.latencybusters.pdm.PDMDefinition.getFieldInfoById ( int  id)
protected

Gets the PDMFieldInfo object by its id

Parameters
idthe 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
deserthe PDMDeserializer to use
bathe 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
deserthe PDMDeserializer to use
bathe byte array to parse
posthe 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
serthe 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
serthe PDMSerializer to use
bathe byte array to serialize into
posthe 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: