org.npsnet.xrti
Class XRTIObjectInstanceHandle

java.lang.Object
  extended byorg.npsnet.xrti.XRTIObjectInstanceHandle
All Implemented Interfaces:
ObjectInstanceHandle, java.io.Serializable

public class XRTIObjectInstanceHandle
extends java.lang.Object
implements ObjectInstanceHandle

Type-safe handle for an object instance. Generally these are created by the run-time infrastructure and passed to the user.

Author:
Andrzej Kapolka
See Also:
Serialized Form

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

Field Detail

identifier

private long identifier
The object instance identifier.

Constructor Detail

XRTIObjectInstanceHandle

protected XRTIObjectInstanceHandle(long pIdentifier)
Constructor.

Parameters:
pIdentifier - the object instance 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 otherObjectInstanceHandle)
Checks this object instance handle for equality with another.

Specified by:
equals in interface ObjectInstanceHandle
Parameters:
otherObjectInstanceHandle - the other object instance handle
Returns:
true if the two handles refer to the same object instance, false otherwise

hashCode

public int hashCode()
Computes and returns a hash code corresponding to this object instance handle.

Specified by:
hashCode in interface ObjectInstanceHandle
Returns:
a hash code corresponding to this object instance handle

encodedLength

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

Specified by:
encodedLength in interface ObjectInstanceHandle
Returns:
the encoded length of this object instance handle

encode

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

Specified by:
encode in interface ObjectInstanceHandle
Parameters:
buffer - the buffer in which to place the encoded value
offset - the offset within the buffer at which to store the value

toString

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

Specified by:
toString in interface ObjectInstanceHandle
Returns:
a string representaiton of this object instance handle