Build 1.0_r1(from source)

java.net
Class Inet4Address

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

public final class Inet4Address
extends InetAddress

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.net.InetAddress
InetAddress.Cache, InetAddress.CacheElement
 
Field Summary
 
Fields inherited from class java.net.InetAddress
ANY, any_bytes, family, hostName, ipaddress, localhost_bytes, LOOPBACK
 
Constructor Summary
Inet4Address(byte[] address)
           
Inet4Address(byte[] address, String name)
           
 
Method Summary
 boolean equals(Object obj)
          Returns true if obj is of the same type as the IPv4 address and they have the same IP address, false otherwise.
 String getHostAddress()
          Returns a String representation of the IP address.
 int hashCode()
          Overrides the basic hashcode function.
 boolean isAnyLocalAddress()
          Returns if the address is the ANY Address
 boolean isLinkLocalAddress()
          Returns whether this address has link-local scope.
 boolean isLoopbackAddress()
          Returns true if the address is a loopback address.
 boolean isMCGlobal()
          Returns true if an address is a global multicast address.
 boolean isMCLinkLocal()
          Returns true if the address is a link-local address.The valid range for IPv4 link-local addresses is: 224.0.0.0 to 239.0.0.255 Hence a mask of 111000000000000000000000 = 0xE00000
 boolean isMCNodeLocal()
          Returns false for all IPv4 addresses.
 boolean isMCOrgLocal()
          Returns true if the address is a organization-local address.
 boolean isMCSiteLocal()
          Returns true if the address is a site-local address.The valid range for IPv4 site-local addresses is: 239.255.0.0 to 239.255.255.255 Hence a mask of 11101111 11111111 = 0xEFFF.
 boolean isMulticastAddress()
          Returns true if the address is a multicast address.
 boolean isSiteLocalAddress()
          Returns whether this address has site-local scope.
 
Methods inherited from class java.net.InetAddress
addressOf, bytesToInt, cacheElement, createHostNameFromIPAddress, getAddress, getAliasesByNameImpl, getAllByName, getByAddress, getByAddress, getByAddress, getByAddressInternal, getByName, getCanonicalHostName, getHostByAddrImpl, getHostByNameImpl, getHostName, getHostNameImpl, getHostNameInternal, getLocalHost, inetAddr, inetAddrImpl, inetNtoaImpl, intToBytes, isReachable, isReachable, lookupHostByName, preferIPv6Addresses, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Inet4Address

Inet4Address(byte[] address)

Inet4Address

Inet4Address(byte[] address,
             String name)
Method Detail

isMulticastAddress

public boolean isMulticastAddress()
Returns true if the address is a multicast address. Valid IPv4 multicast addresses are prefixed with 1110 = 0xE

Overrides:
isMulticastAddress in class InetAddress
Returns:
boolean

isAnyLocalAddress

public boolean isAnyLocalAddress()
Returns if the address is the ANY Address

Overrides:
isAnyLocalAddress in class InetAddress
Returns:
boolean

isLoopbackAddress

public boolean isLoopbackAddress()
Returns true if the address is a loopback address. Loopback ipv4 addresses are prefixed with: 011111111 = 127

Overrides:
isLoopbackAddress in class InetAddress
Returns:
boolean

isLinkLocalAddress

public boolean isLinkLocalAddress()
Returns whether this address has link-local scope. RFC 3484 Default Address Selection for Internet Protocol version 6 (IPv6) states IPv4 auto-configuration addresses, prefix 169.254/16, IPv4 loopback addresses, prefix 127/8, are assigned link-local scope.

Overrides:
isLinkLocalAddress in class InetAddress
Returns:
boolean

isSiteLocalAddress

public boolean isSiteLocalAddress()
Returns whether this address has site-local scope. RFC 3484 Default Address Selection for Internet Protocol version 6 (IPv6) states IPv4 private addresses, prefixes 10/8, 172.16/12, and 192.168/16, are assigned site-local scope.

Overrides:
isSiteLocalAddress in class InetAddress
Returns:
boolean

isMCGlobal

public boolean isMCGlobal()
Returns true if an address is a global multicast address. Valid MCGlobal IPv4 addresses are 224.0.1.0 - 238.255.255.255

Overrides:
isMCGlobal in class InetAddress
Returns:
boolean true, if the address is in the global multicast group, false otherwise

isMCNodeLocal

public boolean isMCNodeLocal()
Returns false for all IPv4 addresses. There are no valid IPv4 Node-local addresses

Overrides:
isMCNodeLocal in class InetAddress
Returns:
boolean

isMCLinkLocal

public boolean isMCLinkLocal()
Returns true if the address is a link-local address.The valid range for IPv4 link-local addresses is: 224.0.0.0 to 239.0.0.255 Hence a mask of 111000000000000000000000 = 0xE00000

Overrides:
isMCLinkLocal in class InetAddress
Returns:
boolean

isMCSiteLocal

public boolean isMCSiteLocal()
Returns true if the address is a site-local address.The valid range for IPv4 site-local addresses is: 239.255.0.0 to 239.255.255.255 Hence a mask of 11101111 11111111 = 0xEFFF.

Overrides:
isMCSiteLocal in class InetAddress
Returns:
boolean

isMCOrgLocal

public boolean isMCOrgLocal()
Returns true if the address is a organization-local address. The valid range for IPv4 org-local addresses is: 239.192.0.0 to 239.195.255.255 Hence masks of 11101111 11000000 to 11101111 11000011 are valid. 0xEFC0 to 0xEFC3

Overrides:
isMCOrgLocal in class InetAddress
Returns:
true if org local address, false otherwise

getHostAddress

public String getHostAddress()
Returns a String representation of the IP address.

Overrides:
getHostAddress in class InetAddress
Returns:
Host address

hashCode

public int hashCode()
Overrides the basic hashcode function.

Overrides:
hashCode in class InetAddress
Returns:
the hash code
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(Object obj)
Returns true if obj is of the same type as the IPv4 address and they have the same IP address, false otherwise.

Overrides:
equals in class InetAddress
Parameters:
obj - the object to be tested for equality
Returns:
true if equal and false otherwise
See Also:
Object.hashCode()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature