|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.antnet.UdpNid
An UDP anthill identifier is composed by an IP address plus an UDP port. This information is used to contact an UDP anthill. Methods equals(), hashcode() and toString() are implemented opportunely.
Constructor Summary | |
UdpNid()
Default constructor needed for externalization. |
|
UdpNid(java.net.InetAddress address,
int port)
Instantiates a new UDP anthill id and sets both the address and the port number. |
|
UdpNid(int port)
Instantiates a new UDP anthill id with the specified port number, using the local address as IP address. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Check if two UdpNid objects are equals. |
java.net.InetAddress |
getAddress()
Returns the address contained in this id. |
int |
getPort()
Returns the port number contained in this id. |
int |
hashCode()
Returns a hash code value for the object. |
void |
readExternal(java.io.ObjectInput in)
Read a UdpNid from a stream. |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
writeExternal(java.io.ObjectOutput out)
Write a UdpNid to a stream. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public UdpNid()
public UdpNid(int port) throws java.net.UnknownHostException
public UdpNid(java.net.InetAddress address, int port)
Method Detail |
public java.net.InetAddress getAddress()
public int getPort()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |