|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.InetAddress
java.net.Inet6Address
public final class Inet6Address
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.net.InetAddress |
|---|
InetAddress.Cache, InetAddress.CacheElement |
| Field Summary | |
|---|---|
(package private) static InetAddress |
ANY
|
(package private) static byte[] |
any_bytes
|
(package private) String |
ifname
|
(package private) static byte[] |
localhost_bytes
|
(package private) static InetAddress |
LOOPBACK
|
(package private) int |
scope_id
|
(package private) boolean |
scope_id_set
|
(package private) boolean |
scope_ifname_set
|
(package private) NetworkInterface |
scopedIf
|
| Fields inherited from class java.net.InetAddress |
|---|
family, hostName, ipaddress |
| Constructor Summary | |
|---|---|
Inet6Address(byte[] address)
|
|
Inet6Address(byte[] address,
int scope_id)
Constructs an InetAddress, representing the address and
hostName and scope_id |
|
Inet6Address(byte[] address,
String name)
|
|
Inet6Address(byte[] address,
String name,
int scope_id)
Constructs an InetAddress, representing the address and
hostName and scope_id |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Returns true if obj is of the same type as the IPv6 address and they have the same IP address, false otherwise. |
static Inet6Address |
getByAddress(String host,
byte[] addr,
int scope_id)
Constructs an IPv6 address according to the given host,
addr and scope_id. |
static Inet6Address |
getByAddress(String host,
byte[] addr,
NetworkInterface nif)
Constructs an IPv6 address according to the given host,
addr and nif. |
String |
getHostAddress()
Answer the dotted string IP address representing this address. |
NetworkInterface |
getScopedInterface()
Returns the network interface if this address is instanced with a scoped network interface. |
int |
getScopeId()
Returns the scope id of this address if it is associated
with an interface. |
int |
hashCode()
Returns the hashcode of the receiver. |
boolean |
isAnyLocalAddress()
Answer true if the InetAddress is the unspecified address "::". |
boolean |
isIPv4CompatibleAddress()
An IPv4 compatible address is prefixed with 96 bits of 0's. |
boolean |
isLinkLocalAddress()
Answer true if the InetAddress is a link-local address. |
boolean |
isLoopbackAddress()
Answer true if the InetAddress is the loopback address The valid IPv6 loopback address is ::1 |
boolean |
isMCGlobal()
Answer true if the InetAddress is a global multicast address. |
boolean |
isMCLinkLocal()
Answer true if the InetAddress is a link-local multicast address. |
boolean |
isMCNodeLocal()
Answer true if the InetAddress is a node-local multicast address. |
boolean |
isMCOrgLocal()
Answer true if the InetAddress is a org-local multicast address. |
boolean |
isMCSiteLocal()
Answer true if the InetAddress is a site-local multicast address. |
boolean |
isMulticastAddress()
Answer true if the InetAddress is an IP multicast address. |
boolean |
isSiteLocalAddress()
Answer true if the InetAddress is a site-local address. |
String |
toString()
Returns a string containing a concise, human-readable description of the address. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final byte[] any_bytes
static final byte[] localhost_bytes
static final InetAddress ANY
static final InetAddress LOOPBACK
int scope_id
boolean scope_id_set
boolean scope_ifname_set
String ifname
transient NetworkInterface scopedIf
| Constructor Detail |
|---|
Inet6Address(byte[] address)
Inet6Address(byte[] address,
String name)
Inet6Address(byte[] address,
String name,
int scope_id)
address and
hostName and scope_id
address - network addressname - Name associated with the addressscope_id - The scope id for link or site local addresses
Inet6Address(byte[] address,
int scope_id)
address and
hostName and scope_id
address - network addressscope_id - The scope id for link or site local addresses| Method Detail |
|---|
public static Inet6Address getByAddress(String host,
byte[] addr,
int scope_id)
throws UnknownHostException
host,
addr and scope_id.
host - hostname associated with the addressaddr - network addressscope_id - the scope id for link or site local addresses
UnknownHostException - if the address is null or of invalid length
public static Inet6Address getByAddress(String host,
byte[] addr,
NetworkInterface nif)
throws UnknownHostException
host,
addr and nif. scope_id is
set according to the given nif and the
addr type(e.g. site local or link local).
- Parameters:
host - host name associated with the addressaddr - network addressnif - the Network Interface that this address is associated with.
- Returns:
- an Inet6Address instance
- Throws:
UnknownHostException - if the address is null or of invalid length, or the
interface doesn't have a numeric scope id for the given
address type.
public boolean isMulticastAddress()
isMulticastAddress in class InetAddresspublic boolean isAnyLocalAddress()
isAnyLocalAddress in class InetAddresspublic boolean isLoopbackAddress()
isLoopbackAddress in class InetAddresspublic boolean isLinkLocalAddress()
isLinkLocalAddress in class InetAddresspublic boolean isSiteLocalAddress()
isSiteLocalAddress in class InetAddresspublic boolean isMCGlobal()
isMCGlobal in class InetAddresspublic boolean isMCNodeLocal()
isMCNodeLocal in class InetAddresspublic boolean isMCLinkLocal()
isMCLinkLocal in class InetAddresspublic boolean isMCSiteLocal()
isMCSiteLocal in class InetAddresspublic boolean isMCOrgLocal()
isMCOrgLocal in class InetAddresspublic String getHostAddress()
InetAddress
getHostAddress in class InetAddresspublic int getScopeId()
scope id of this address if it is associated
with an interface. Otherwise returns zero.
public NetworkInterface getScopedInterface()
public int hashCode()
hashCode in class InetAddressObject.equals(java.lang.Object)public boolean equals(Object obj)
equals in class InetAddressobj - the object to be tested for equality
Object.hashCode()public boolean isIPv4CompatibleAddress()
public String toString()
toString in class InetAddress
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||