public class InetNetwork
extends java.lang.Object
Constructor and Description |
---|
InetNetwork(java.net.InetAddress inetAddress,
int subnetBits)
Create a internet mask.
|
Modifier and Type | Method and Description |
---|---|
static InetNetwork |
create(java.lang.String network) |
boolean |
isMatch(java.net.InetAddress inetAddress)
Returns true if the address is in this network.
|
boolean |
isMatch(java.lang.String address)
Returns true if the address is in this network.
|
java.lang.String |
toString()
Return a readable string.
|
static InetNetwork |
valueOf(java.lang.String network) |
public InetNetwork(java.net.InetAddress inetAddress, int subnetBits)
inetAddress
- the main addressmaskIndex
- the number of bits to match.public static InetNetwork valueOf(java.lang.String network) throws java.net.UnknownHostException
java.net.UnknownHostException
public static InetNetwork create(java.lang.String network) throws java.net.UnknownHostException
java.net.UnknownHostException
public boolean isMatch(java.net.InetAddress inetAddress)
public boolean isMatch(java.lang.String address)
public java.lang.String toString()
toString
in class java.lang.Object