org.npsnet.xrti
Class XRTIAttributeHandle

java.lang.Object
  extended byorg.npsnet.xrti.XRTIAttributeHandle
All Implemented Interfaces:
AttributeHandle, java.io.Serializable

public class XRTIAttributeHandle
extends java.lang.Object
implements AttributeHandle

Type-safe handle for an attribute. Generally these are created by the RTI and passed to the user.

Author:
Andrzej Kapolka
See Also:
Serialized Form

Field Summary
private  long identifier
          The attribute identifier.
 
Constructor Summary
protected XRTIAttributeHandle(long pIdentifier)
          Constructor.
 
Method Summary
 void encode(byte[] buffer, int offset)
          Encodes this attribute handle, placing the result into the specified array.
 int encodedLength()
          Returns the encoded length of this attribute handle.
 boolean equals(java.lang.Object otherAttributeHandle)
          Checks this attribute handle for equality with another.
protected  long getIdentifier()
          Returns this handle's unique identifier.
 int hashCode()
          Computes and returns the hash code of this attribute handle.
 java.lang.String toString()
          Returns a string representation of this attribute handle.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

identifier

private long identifier
The attribute identifier.

Constructor Detail

XRTIAttributeHandle

protected XRTIAttributeHandle(long pIdentifier)
Constructor.

Parameters:
pIdentifier - the attribute identifier
Method Detail

getIdentifier

protected long getIdentifier()
Returns this handle's unique identifier.

Returns:
this handle's unique identifier

equals

public boolean equals(java.lang.Object otherAttributeHandle)
Checks this attribute handle for equality with another.

Specified by:
equals in interface AttributeHandle
Parameters:
otherAttributeHandle - the other attribute handle to compare this to
Returns:
true if this refers to the same attribute as the other handle, false otherwise

hashCode

public int hashCode()
Computes and returns the hash code of this attribute handle.

Specified by:
hashCode in interface AttributeHandle
Returns:
the hash code corresponding to this attribute handle

encodedLength

public int encodedLength()
Returns the encoded length of this attribute handle.

Specified by:
encodedLength in interface AttributeHandle
Returns:
the encoded length of this attribute handle, in bytes

encode

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

Specified by:
encode in interface AttributeHandle
Parameters:
buffer - the buffer in which to place the encoded handle
offset - the buffer offset at which to store the data

toString

public java.lang.String toString()
Returns a string representation of this attribute handle.

Specified by:
toString in interface AttributeHandle
Returns:
a string representation of this attribute handle