Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----java.net.InetAddress
Applications should use the methods getLocalHost
,
getByName
, or getAllByName
to
create a new InetAddress
instance.
Method Summary | |
boolean | equals(Object obj)
|
byte[] | getAddress()
InetAddress
object.
|
static InetAddress[] | getAllByName(String host)
|
static InetAddress | getByName(String host)
|
String | getHostAddress()
|
String | getHostName()
|
static InetAddress | getLocalHost()
|
int | hashCode()
|
boolean | isMulticastAddress()
|
String | toString()
String .
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public boolean isMulticastAddress()
public String getHostName()
public byte[] getAddress()
InetAddress
object. The result is in network byte order: the highest order
byte of the address is in getAddress()[0]
.public String getHostAddress()
public int hashCode()
public boolean equals(Object obj)
true
if and only if the argument is
not null
and it represents the same IP address as
this object.
Two instances of InetAddress
represent the same IP
address if the length of the byte arrays returned by
getAddress
is the same for both, and each of the
array components is the same for the byte arrays.
obj
- the object to compare against.
true
if the objects are the same;
false
otherwise.public String toString()
String
.public static InetAddress getByName(String host) throws UnknownHostException
java.sun.com
", or a string representing its IP
address, such as "206.26.48.100
".
host
- the specified host, or null
for the
local host.
host
could be found.public static InetAddress[] getAllByName(String host) throws UnknownHostException
java.sun.com
", or a string representing
its IP address, such as "206.26.48.100
".
host
- the name of the host.
host
could be found.public static InetAddress getLocalHost() throws UnknownHostException
host
could be found.Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |