solar.service.transport
Class PastryAddress

java.lang.Object
  |
  +--solar.service.transport.PastryAddress
All Implemented Interfaces:
Address, java.io.Serializable

public class PastryAddress
extends java.lang.Object
implements Address

Network address for Pastry substrate. Note rice.pastry.messaging.Address is different and used to demulplex on the same Pastry node.

Version:
$Id: PastryAddress.java,v 1.10 2003/10/05 18:51:03 glchen Exp $
Author:
Guanling Chen
See Also:
Serialized Form

Field Summary
protected  int _hashcode
           
protected  rice.pastry.Id _nodeId
           
 
Constructor Summary
PastryAddress()
          Construct a Pastry address with a random Node ID.
PastryAddress(byte[] id)
          Construct a Pastry address with specified Node ID in byte array.
PastryAddress(rice.pastry.Id id)
          Construct a Pastry address with specified Node ID.
 
Method Summary
private  void construction()
          Common constructor operatoions.
 boolean equals(java.lang.Object obj)
          Test whether two addresses are equals.
 int getEncoding()
          Return the encoding of this address.
 rice.pastry.Id getNodeId()
          Return the pastry node ID for this address.
 int hashCode()
          Return the hash code of this address.
 byte[] toBytes()
          Return the byte array representation of this address.
 java.lang.String toString()
          Return the string representation of this address.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_nodeId

protected rice.pastry.Id _nodeId

_hashcode

protected int _hashcode
Constructor Detail

PastryAddress

public PastryAddress(rice.pastry.Id id)
Construct a Pastry address with specified Node ID.


PastryAddress

public PastryAddress(byte[] id)
Construct a Pastry address with specified Node ID in byte array.


PastryAddress

public PastryAddress()
Construct a Pastry address with a random Node ID.

Method Detail

construction

private void construction()
Common constructor operatoions.


toString

public java.lang.String toString()
Description copied from interface: Address
Return the string representation of this address.

Specified by:
toString in interface Address
Overrides:
toString in class java.lang.Object

toBytes

public byte[] toBytes()
Description copied from interface: Address
Return the byte array representation of this address.

Specified by:
toBytes in interface Address

getEncoding

public int getEncoding()
Description copied from interface: Address
Return the encoding of this address.

Specified by:
getEncoding in interface Address

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: Address
Test whether two addresses are equals.

Specified by:
equals in interface Address
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Description copied from interface: Address
Return the hash code of this address.

Specified by:
hashCode in interface Address
Overrides:
hashCode in class java.lang.Object

getNodeId

public rice.pastry.Id getNodeId()
Return the pastry node ID for this address.