public class SubnetUtils extends Object
Constructor and Description |
---|
SubnetUtils(String address,
String mask)
Constructs an instance from a dotted decimal address and a dotted decimal mask.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isInRange(String address)
Tests if the parameter
address is in the range of usable endpoint addresses for this subnet. |
public SubnetUtils(String address, String mask)
address
- An IP address, e.g. "192.168.0.1"mask
- A dotted decimal netmask e.g. "255.255.0.0"IllegalArgumentException
- if the address or mask is invalid, i.e. does not match n.n.n.n where n=1-3 decimal digits and the mask is not all zerospublic boolean isInRange(String address)
address
is in the range of usable endpoint addresses for this subnet.
This excludes the network and broadcast addresses.address
- A dot-delimited IPv4 address, e.g. "192.168.0.1"Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.