org.npsnet.xrti
Class XRTIFederateHandle

java.lang.Object
  extended byorg.npsnet.xrti.XRTIFederateHandle
All Implemented Interfaces:
FederateHandle, java.io.Serializable

public class XRTIFederateHandle
extends java.lang.Object
implements FederateHandle

Type-safe handle for a federate. 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 federate identifier.
 
Constructor Summary
protected XRTIFederateHandle(long pIdentifier)
          Constructor.
 
Method Summary
 void encode(byte[] buffer, int offset)
          Encodes this federate handle, placing the result into the specified byte array.
 int encodedLength()
          Returns the encoded length of this federate handle.
 boolean equals(java.lang.Object otherFederateHandle)
          Tests this federate handle for equality with another.
protected  long getIdentifier()
          Returns this handle's unique identifier.
 int hashCode()
          Computes and returns the hash code corresponding to this federate handle.
 java.lang.String toString()
          Returns a string representation of this federate handle.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

identifier

private long identifier
The federate identifier.

Constructor Detail

XRTIFederateHandle

protected XRTIFederateHandle(long pIdentifier)
Constructor.

Parameters:
pIdentifier - the federate 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 otherFederateHandle)
Tests this federate handle for equality with another.

Specified by:
equals in interface FederateHandle
Parameters:
otherFederateHandle - the other federate handle to compare this to
Returns:
true if this refers to the same federate as other handle, false otherwise

hashCode

public int hashCode()
Computes and returns the hash code corresponding to this federate handle.

Specified by:
hashCode in interface FederateHandle
Returns:
the hash code corresponding to this federate handle

encodedLength

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

Specified by:
encodedLength in interface FederateHandle
Returns:
the encoded length of this federate handle (in bytes)

encode

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

Specified by:
encode in interface FederateHandle
Parameters:
buffer - the buffer to hold the encoded federate handle
offset - the offset within the buffer at which to store the encoded handle

toString

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

Specified by:
toString in interface FederateHandle
Returns:
a string representation of this federate handle