|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.foundation.net.NetAddr
public class NetAddr
An IP network address and port number combination, represented in a somewhat
friendlier way than InetSocketAddress
does.
| Constructor Summary | |
|---|---|
NetAddr(InetAddress inetAddress,
int portNumber)
Construct a new NetAddr given an IP address and a port number. |
|
NetAddr(String addressStr)
Construct a NetAddr from a string in the form: hostName:portNumber or hostName. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object other)
Test if another object is a NetAddr denoting the same address as this. |
int |
getPort()
Get the port number. |
int |
hashCode()
Get a hash code for this address. |
InetAddress |
inetAddress()
Get the IP address. |
String |
toString()
Produce a printable representation of this. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NetAddr(String addressStr)
throws UnknownHostException
addressStr - The network address string, as described above.
UnknownHostException - if the host name can't be resolved.
public NetAddr(InetAddress inetAddress,
int portNumber)
inetAddress - An IP address, where null => all local IP addresses.portNumber - A port at that IP address.| Method Detail |
|---|
public boolean equals(Object other)
equals in class Objectother - The other object to test for equality.
public InetAddress inetAddress()
public int getPort()
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||