API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.net. InetAddress View Source
Author(s)
Chris Warth
Since
JDK1.0
Version
1.116, 09/05/07
Serial
Hierarchy
 Object
      InetAddress
Implements
 Serializable
Subclasses
Description
public class InetAddress
  This class represents an Internet Protocol (IP) address.
Constructors
pack-private InetAddress ()
  Constructor for the Socket.accept() method.
Methods
Hide/Show inherited methods
pack-privatestatic InetAddress anyLocalAddress ()
public boolean equals (Object obj)
  Compares this object against the specified object.
public byte getAddress ()
  Returns the raw IP address of this InetAddress object.
publicstatic InetAddress getAllByName (String host) throws UnknownHostException
  Given the name of a host, returns an array of its IP addresses, based on the configured name service on the system.
pack-privatestatic InetAddress getAllByName0 (String host, boolean check) throws UnknownHostException
package private so SocketPermission can call it
publicstatic InetAddress getByAddress (byte[] addr) throws UnknownHostException
  Returns an InetAddress object given the raw IP address .
publicstatic InetAddress getByAddress (String host, byte[] addr) throws UnknownHostException
  Create an InetAddress based on the provided host name and IP address No name service is checked for the validity of the address.
publicstatic InetAddress getByName (String host) throws UnknownHostException
  Determines the IP address of a host, given the host's name.
public String getCanonicalHostName ()
  Gets the fully qualified domain name for this IP address.
public String getHostAddress ()
  Returns the IP address string in textual presentation.
public String getHostName ()
  Gets the host name for this IP address.
pack-private String getHostName (boolean check)
  Returns the hostname for this address.
publicstatic InetAddress getLocalHost () throws UnknownHostException
  Returns the local host.
public int hashCode ()
  Returns a hashcode for this IP address.
public boolean isAnyLocalAddress ()
  Utility routine to check if the InetAddress in a wildcard address.
public boolean isLinkLocalAddress ()
  Utility routine to check if the InetAddress is an link local address.
public boolean isLoopbackAddress ()
  Utility routine to check if the InetAddress is a loopback address.
public boolean isMCGlobal ()
  Utility routine to check if the multicast address has global scope.
public boolean isMCLinkLocal ()
  Utility routine to check if the multicast address has link scope.
public boolean isMCNodeLocal ()
  Utility routine to check if the multicast address has node scope.
public boolean isMCOrgLocal ()
  Utility routine to check if the multicast address has organization scope.
public boolean isMCSiteLocal ()
  Utility routine to check if the multicast address has site scope.
public boolean isMulticastAddress ()
  Utility routine to check if the InetAddress is an IP multicast address.
public boolean isReachable (int timeout) throws IOException
  Test whether that address is reachable.
public boolean isReachable (NetworkInterface netif, int ttl, int timeout) throws IOException
  Test whether that address is reachable.
public boolean isSiteLocalAddress ()
  Utility routine to check if the InetAddress is a site local address.
pack-privatestatic Object loadImpl (String implName)
public String toString ()
  Converts this IP address to a String.
Fields
Hide/Show inherited fields
pack-private int address
Holds a 32-bit IPv4 address.
pack-private int family
Specifies the address family type, for instance, '1' for IPv4 addresses, and '2' for IPv6 addresses.
pack-private String hostName
pack-privatestatic InetAddressImpl impl
pack-privatefinalstatic int IPv4 = "1"
  Specify the address family: Internet Protocol, Version 4
pack-privatefinalstatic int IPv6 = "2"
  Specify the address family: Internet Protocol, Version 6
pack-privatestatictransient boolean preferIPv6Address
pack-privatestatic InetAddress unknown_array
Nested Classes
  InetAddress.CacheEntry
Represents a cache entry
  InetAddress.Cache
A cache that manages entries based on a policy specified at creation time.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar