java.net
Class Inet6Address

java.lang.Object
  extended by java.net.InetAddress
      extended by java.net.Inet6Address
All Implemented Interfaces:
Serializable

public final class Inet6Address
extends InetAddress

See Also:
Serialized Form

Method Summary
 boolean equals(Object obj)
          Compares this object against the specified object
 byte[] getAddress()
          Returns the raw IP address of this InetAddress object.
static Inet6Address getByAddress(String host, byte[] addr, int scopeId)
          Creates a scoped Inet6Address where the scope has an integer id.
static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
          Creates a scoped Inet6Address where the scope is a given NetworkInterface.
 String getHostAddress()
          Returns the IP address string in textual presentation
 NetworkInterface getScopedInterface()
          Returns the NetworkInterface of the address scope if it is a scoped address and the scope is given in the form of a NetworkInterface.
 int getScopeId()
          Returns the scope ID of the address scope if it is a scoped adress using an integer to identify the scope.
 int hashCode()
          Returns a hashcode for this IP address (The hashcode is independent of scope)
 boolean isAnyLocalAddress()
          Utility routine to check if the InetAddress in a wildcard address
 boolean isIPv4CompatibleAddress()
          Utility routine to check if the InetAddress is an IPv4 compatible IPv6 address
 boolean isLinkLocalAddress()
          Utility routine to check if the InetAddress is an link local address
 boolean isLoopbackAddress()
          Utility routine to check if the InetAddress is a loopback address
 boolean isMCGlobal()
          Utility routine to check if the multicast address has global scope
 boolean isMCLinkLocal()
          Utility routine to check if the multicast address has link scope
 boolean isMCNodeLocal()
          Utility routine to check if the multicast address has node scope
 boolean isMCOrgLocal()
          Utility routine to check if the multicast address has organization scope
 boolean isMCSiteLocal()
          Utility routine to check if the multicast address has site scope
 boolean isMulticastAddress()
          Utility routine to check if the InetAddress is an IP multicast address
 boolean isSiteLocalAddress()
          Utility routine to check if the InetAddress is a site local address
 
Methods inherited from class java.net.InetAddress
getAllByName, getByAddress, getByAddress, getByName, getCanonicalHostName, getHostName, getLocalHost, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

isMulticastAddress

public boolean isMulticastAddress()
Utility routine to check if the InetAddress is an IP multicast address

Overrides:
isMulticastAddress in class InetAddress
Returns:
true if mulitcast, false if not
Since:
1.1

isAnyLocalAddress

public boolean isAnyLocalAddress()
Utility routine to check if the InetAddress in a wildcard address

Overrides:
isAnyLocalAddress in class InetAddress
Since:
1.4

isLoopbackAddress

public boolean isLoopbackAddress()
Utility routine to check if the InetAddress is a loopback address

Overrides:
isLoopbackAddress in class InetAddress
Since:
1.4

isLinkLocalAddress

public boolean isLinkLocalAddress()
Utility routine to check if the InetAddress is an link local address

Overrides:
isLinkLocalAddress in class InetAddress
Since:
1.4

isSiteLocalAddress

public boolean isSiteLocalAddress()
Utility routine to check if the InetAddress is a site local address

Overrides:
isSiteLocalAddress in class InetAddress
Since:
1.4

isMCGlobal

public boolean isMCGlobal()
Utility routine to check if the multicast address has global scope

Overrides:
isMCGlobal in class InetAddress
Since:
1.4

isMCNodeLocal

public boolean isMCNodeLocal()
Utility routine to check if the multicast address has node scope

Overrides:
isMCNodeLocal in class InetAddress
Since:
1.4

isMCLinkLocal

public boolean isMCLinkLocal()
Utility routine to check if the multicast address has link scope

Overrides:
isMCLinkLocal in class InetAddress
Since:
1.4

isMCSiteLocal

public boolean isMCSiteLocal()
Utility routine to check if the multicast address has site scope

Overrides:
isMCSiteLocal in class InetAddress
Since:
1.4

isMCOrgLocal

public boolean isMCOrgLocal()
Utility routine to check if the multicast address has organization scope

Overrides:
isMCOrgLocal in class InetAddress
Since:
1.4

getAddress

public byte[] getAddress()
Returns the raw IP address of this InetAddress object. The result is in network byte order: the highest order byte of the address is i n getAddress()[0]

Overrides:
getAddress in class InetAddress
Returns:
IP address

getByAddress

public static Inet6Address getByAddress(String host,
                                        byte[] addr,
                                        int scopeId)
                                 throws UnknownHostException
Creates a scoped Inet6Address where the scope has an integer id.

Throws:
UnkownHostException - if the address is an invalid number of bytes.
UnknownHostException
Since:
1.5

getByAddress

public static Inet6Address getByAddress(String host,
                                        byte[] addr,
                                        NetworkInterface nif)
                                 throws UnknownHostException
Creates a scoped Inet6Address where the scope is a given NetworkInterface.

Throws:
UnkownHostException - if the address is an invalid number of bytes.
UnknownHostException
Since:
1.5

getScopedInterface

public NetworkInterface getScopedInterface()
Returns the NetworkInterface of the address scope if it is a scoped address and the scope is given in the form of a NetworkInterface. (I.e. the address was created using the getByAddress(String, byte[], NetworkInterface) method) Otherwise this method returns null.

Since:
1.5

getScopeId

public int getScopeId()
Returns the scope ID of the address scope if it is a scoped adress using an integer to identify the scope. Otherwise this method returns 0.

Since:
1.5

getHostAddress

public String getHostAddress()
Returns the IP address string in textual presentation

Overrides:
getHostAddress in class InetAddress
Returns:
The IP address of this object in String form

hashCode

public int hashCode()
Returns a hashcode for this IP address (The hashcode is independent of scope)

Overrides:
hashCode in class InetAddress
Returns:
A hash value for this address.
See Also:
Object.equals(Object), System.identityHashCode(Object)

equals

public boolean equals(Object obj)
Compares this object against the specified object

Overrides:
equals in class InetAddress
Parameters:
obj - The address to test for equality
Returns:
true if the passed in object's address is equal to this one's, false otherwise
See Also:
Object.hashCode()

isIPv4CompatibleAddress

public boolean isIPv4CompatibleAddress()
Utility routine to check if the InetAddress is an IPv4 compatible IPv6 address

Since:
1.4