net.i2p.router.transport.udp
Class RemoteHostId

java.lang.Object
  extended by net.i2p.router.transport.udp.RemoteHostId

final class RemoteHostId
extends Object

Unique ID for a peer - its IP + port, all bundled into a tidy obj. If the remote peer is not reachable through an IP+port, this contains the hash of their identity.


Constructor Summary
RemoteHostId(byte[] ip, int port)
          direct
RemoteHostId(Hash peerHash)
          indirect
 
Method Summary
 boolean equals(Object obj)
           
 byte[] getIP()
           
 Hash getPeerHash()
           
 int getPort()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteHostId

public RemoteHostId(byte[] ip,
                    int port)
direct


RemoteHostId

public RemoteHostId(Hash peerHash)
indirect

Method Detail

getIP

public byte[] getIP()
Returns:
null if indirect

getPort

public int getPort()
Returns:
0 if indirect

getPeerHash

public Hash getPeerHash()
Returns:
null if direct

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object