hla.rti
Class OrderType

java.lang.Object
  extended byhla.rti.OrderType
All Implemented Interfaces:
java.io.Serializable

public final class OrderType
extends java.lang.Object
implements java.io.Serializable

Represents a type of message ordering.

Author:
DMSO
See Also:
Serialized Form

Field Summary
static OrderType RECEIVE
          The receive-order type.
static OrderType TIMESTAMP
          The timestamp-order type.
private  int value
          The value of the instance.
 
Constructor Summary
private OrderType(int pValue)
          Private constructor.
  OrderType(OrderType otherOrderType)
          Copy constructor.
 
Method Summary
static OrderType decode(byte[] buffer, int offset)
          Decodes an order type stored within the specified buffer and returns a corresponding OrderType instance.
 void encode(byte[] buffer, int offset)
          Encodes this order type, placing the result into the specified buffer.
 int encodedLength()
          Returns the encoded length of this order type.
 boolean equals(java.lang.Object otherOrderType)
          Compares this order type for equality with another.
 int hashCode()
          Computes and returns a hash code corresponding to this order type.
 java.lang.String toString()
          Returns a string representation of this order type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RECEIVE

public static final OrderType RECEIVE
The receive-order type.


TIMESTAMP

public static final OrderType TIMESTAMP
The timestamp-order type.


value

private int value
The value of the instance.

Constructor Detail

OrderType

public OrderType(OrderType otherOrderType)
Copy constructor.

Parameters:
otherOrderType - the order type to copy

OrderType

private OrderType(int pValue)
Private constructor.

Parameters:
pValue - the integer value corresponding to this order type
Method Detail

decode

public static OrderType decode(byte[] buffer,
                               int offset)
                        throws CouldNotDecode
Decodes an order type stored within the specified buffer and returns a corresponding OrderType instance.

Parameters:
buffer - the buffer in which the encoded value is stored
offset - the offset within the buffer at which the encoded value is located
Returns:
an OrderType corresponding to the decoded value
Throws:
CouldNotDecode - if the order type could not be decoded

equals

public boolean equals(java.lang.Object otherOrderType)
Compares this order type for equality with another.

Parameters:
otherOrderType - the other order type
Returns:
true if the two order types are equal, false otherwise

hashCode

public int hashCode()
Computes and returns a hash code corresponding to this order type.

Returns:
a hash code corresponding to this order type

encodedLength

public int encodedLength()
Returns the encoded length of this order type.

Returns:
the encoded length of this order type (in bytes)

encode

public void encode(byte[] buffer,
                   int offset)
Encodes this order type, placing the result into the specified buffer.

Parameters:
buffer - the buffer in which to place the encoded value
offset - the offset within the buffer at which to store the encoded value

toString

public java.lang.String toString()
Returns a string representation of this order type.

Returns:
a string representation of this order type