<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.net.InetAddress
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.net.html">This Package</a>  <a href="java.net.HttpURLConnection.html#_top_">Previous</a>  <a href="java.net.MulticastSocket.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.net.InetAddress
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.net.InetAddress
</pre>
<hr>
<dl>
  <dt> public final class <b>InetAddress</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
This class represents an Internet Protocol (IP) address.
 <p>
 Applications should use the methods <code>getLocalHost</code>,
 <code>getByName</code>, or <code>getAllByName</code> to
 create a new <code>InetAddress</code> instance.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#getAllByName(java.lang.String)">getAllByName</a>, <a href="#getByName(java.lang.String)">getByName</a>, <a href="#getLocalHost()">getLocalHost</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)
  <dd>  Compares this object against the specified object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAddress()"><b>getAddress</b></a>()
  <dd>  Returns the raw IP address of this <code>InetAddress</code>
 object.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAllByName(java.lang.String)"><b>getAllByName</b></a>(String)
  <dd>  Determines all the IP addresses of a host, given the host's name.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getByName(java.lang.String)"><b>getByName</b></a>(String)
  <dd>  Determines the IP address of a host, given the host's name.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHostAddress()"><b>getHostAddress</b></a>()
  <dd>  Returns the IP address string "%d.%d.%d.%d"
 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHostName()"><b>getHostName</b></a>()
  <dd>  Returns the host name for this address.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLocalHost()"><b>getLocalHost</b></a>()
  <dd>  Returns the local host.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#hashCode()"><b>hashCode</b></a>()
  <dd>  Returns a hashcode for this IP address.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#isMulticastAddress()"><b>isMulticastAddress</b></a>()
  <dd>  Utility routine to check if the InetAddress is a
 IP multicast address.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Converts this IP address to a <code>String</code>.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="isMulticastAddress()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isMulticastAddress"><b>isMulticastAddress</b></a>
<pre>
 public boolean isMulticastAddress()
</pre>
<dl>
  <dd> Utility routine to check if the InetAddress is a
 IP multicast address. IP multicast address is a Class D
 address i.e first four bits of the address are 1110.
<p>
</dl>
<a name="getHostName()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHostName"><b>getHostName</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getHostName()
</pre>
<dl>
  <dd> Returns the host name for this address.
 If the host is equal to null, then this address refers to any
 of the local machine's available network addresses.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the fully qualified host name for this address.
  </dl></dd>
</dl>
<a name="getAddress()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAddress"><b>getAddress</b></a>
<pre>
 public byte[] getAddress()
</pre>
<dl>
  <dd> Returns the raw IP address of this <code>InetAddress</code>
 object. The result is in network byte order: the highest order
 byte of the address is in <code>getAddress()[0]</code>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the raw IP address of this object.
  </dl></dd>
</dl>
<a name="getHostAddress()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHostAddress"><b>getHostAddress</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getHostAddress()
</pre>
<dl>
  <dd> Returns the IP address string "%d.%d.%d.%d"
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> raw IP address in a string format
  </dl></dd>
</dl>
<a name="hashCode()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="hashCode"><b>hashCode</b></a>
<pre>
 public int hashCode()
</pre>
<dl>
  <dd> Returns a hashcode for this IP address.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a hash code value for this IP address.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#hashCode()">hashCode</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="equals(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="equals"><b>equals</b></a>
<pre>
 public boolean equals(<a href="java.lang.Object.html#_top_">Object</a> obj)
</pre>
<dl>
  <dd> Compares this object against the specified object.
 The result is <code>true</code> if and only if the argument is
 not <code>null</code> and it represents the same IP address as
 this object.
 <p>
 Two instances of <code>InetAddress</code> represent the same IP
 address if the length of the byte arrays returned by
 <code>getAddress</code> is the same for both, and each of the
 array components is the same for the byte arrays.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> obj - the object to compare against.
    <dt> <b>Returns:</b>
    <dd> <code>true</code> if the objects are the same;
          <code>false</code> otherwise.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#equals(java.lang.Object)">equals</a> in class <a href="java.lang.Object.html#_top_">Object</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#getAddress()">getAddress</a>
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Converts this IP address to a <code>String</code>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this IP address.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="getByName(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getByName"><b>getByName</b></a>
<pre>
 public static <a href="#_top_">InetAddress</a> getByName(<a href="java.lang.String.html#_top_">String</a> host) throws <a href="java.net.UnknownHostException.html#_top_">UnknownHostException</a>
</pre>
<dl>
  <dd> Determines the IP address of a host, given the host's name. The
 host name can either be a machine name, such as
 "<code>java.sun.com</code>", or a string representing its IP
 address, such as "<code>206.26.48.100</code>".
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> host - the specified host, or <code>null</code> for the
                    local host.
    <dt> <b>Returns:</b>
    <dd> an IP address for the given host name.
    <dt> <b>Throws:</b> <a href="java.net.UnknownHostException.html#_top_">UnknownHostException</a>
    <dd> if no IP address for the
               <code>host</code> could be found.
  </dl></dd>
</dl>
<a name="getAllByName(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAllByName"><b>getAllByName</b></a>
<pre>
 public static <a href="#_top_">InetAddress</a>[] getAllByName(<a href="java.lang.String.html#_top_">String</a> host) throws <a href="java.net.UnknownHostException.html#_top_">UnknownHostException</a>
</pre>
<dl>
  <dd> Determines all the IP addresses of a host, given the host's name.
 The host name can either be a machine name, such as
 "<code>java.sun.com</code>", or a string representing
 its IP address, such as "<code>206.26.48.100</code>".
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> host - the name of the host.
    <dt> <b>Returns:</b>
    <dd> an array of all the IP addresses for a given host name.
    <dt> <b>Throws:</b> <a href="java.net.UnknownHostException.html#_top_">UnknownHostException</a>
    <dd> if no IP address for the
               <code>host</code> could be found.
  </dl></dd>
</dl>
<a name="getLocalHost()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLocalHost"><b>getLocalHost</b></a>
<pre>
 public static <a href="#_top_">InetAddress</a> getLocalHost() throws <a href="java.net.UnknownHostException.html#_top_">UnknownHostException</a>
</pre>
<dl>
  <dd> Returns the local host.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the IP address of the local host.
    <dt> <b>Throws:</b> <a href="java.net.UnknownHostException.html#_top_">UnknownHostException</a>
    <dd> if no IP address for the
               <code>host</code> could be found.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.net.html">This Package</a>  <a href="java.net.HttpURLConnection.html#_top_">Previous</a>  <a href="java.net.MulticastSocket.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
