public abstract class IPAddress extends Object
Modifier and Type | Field and Description |
---|---|
protected InetAddress |
javaNetAddress |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
byte[] |
getAddress()
Returns the raw IP address of this InetAddress object.
|
static IPAddress |
getByAddress(byte[] addr)
Returns an InetAddress object given the raw IP address.
|
static IPAddress |
getByAddress(int addr) |
String |
getHostAddress()
Returns the IP address string in textual presentation.
|
int |
hashCode() |
boolean |
isAnyLocalAddress()
Utility routine to check if the InetAddress in a wildcard 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.}
|
static IPAddress |
parseHostAddress(String hostAddress)
Parse a literal representation of an IP address and returns the
corresponding IPAddress class.
|
protected InetAddress javaNetAddress
public static IPAddress getByAddress(byte[] addr) throws UnknownHostException
addr
- - the raw IP address in network byte orderUnknownHostException
public static IPAddress getByAddress(int addr) throws UnknownHostException
UnknownHostException
public static IPAddress parseHostAddress(String hostAddress) throws UnknownHostException
hostAddress
- UnknownHostException
public byte[] getAddress()
public String getHostAddress()
public boolean isAnyLocalAddress()
public boolean isLinkLocalAddress()
public boolean isLoopbackAddress()
public boolean isMCGlobal()
public boolean isMCLinkLocal()
public boolean isMCNodeLocal()
public boolean isMCOrgLocal()
public boolean isMCSiteLocal()
public boolean isMulticastAddress()
public boolean isSiteLocalAddress()
Copyright © 2013. All Rights Reserved.