| Modifier and Type | Class and Description |
|---|---|
| public class | SubnetUtils.
Convenience container for subnet summary information. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final Pattern | |
| private int | |
| private static final Pattern | |
| private boolean | inclusiveHostCount
Whether the broadcast/network address are included in host count |
| private static final String | |
| private static final int | |
| private int | |
| private int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | SubnetUtils(String
A CIDR-notation string, e.g. "192.168.0.1/16" cidrNotation)Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16" |
| public | SubnetUtils(String
An IP address, e.g. "192.168.0.1" address, String A dotted decimal netmask e.g. "255.255.0.0" mask)Constructor that takes a dotted decimal address and a dotted decimal mask. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private String | |
| public final SubnetUtils. | |
| public boolean | isInclusiveHostCount()
Returns |
| private int | |
| pack-priv int | |
| private int | |
| public void | setInclusiveHostCount(boolean inclusiveHostCount)
Set to |
| private int[] | |
| private String | |
| private int |
| address | back to summary |
|---|---|
| private int address | |
| addressPattern | back to summary |
|---|---|
| private static final Pattern addressPattern | |
| broadcast | back to summary |
|---|---|
| private int broadcast | |
| cidrPattern | back to summary |
|---|---|
| private static final Pattern cidrPattern | |
| inclusiveHostCount | back to summary |
|---|---|
| private boolean inclusiveHostCount Whether the broadcast/network address are included in host count | |
| IP_ADDRESS | back to summary |
|---|---|
| private static final String IP_ADDRESS | |
| NBITS | back to summary |
|---|---|
| private static final int NBITS | |
| netmask | back to summary |
|---|---|
| private int netmask | |
| network | back to summary |
|---|---|
| private int network | |
| SLASH_FORMAT | back to summary |
|---|---|
| private static final String SLASH_FORMAT | |
| SubnetUtils | back to summary |
|---|---|
| public SubnetUtils(String cidrNotation) Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16"
| |
| SubnetUtils | back to summary |
|---|---|
| public SubnetUtils(String address, String mask) Constructor that takes a dotted decimal address and a dotted decimal mask.
| |
| calculate | back to summary |
|---|---|
| private void calculate(String mask) | |
| format | back to summary |
|---|---|
| private String format(int[] octets) | |
| getInfo | back to summary |
|---|---|
| public final SubnetUtils. Return a
| |
| isInclusiveHostCount | back to summary |
|---|---|
| public boolean isInclusiveHostCount() Returns
| |
| matchAddress | back to summary |
|---|---|
| private int matchAddress(Matcher matcher) | |
| pop | back to summary |
|---|---|
| pack-priv int pop(int x) | |
| rangeCheck | back to summary |
|---|---|
| private int rangeCheck(int value, int begin, int end) | |
| setInclusiveHostCount | back to summary |
|---|---|
| public void setInclusiveHostCount(boolean inclusiveHostCount) Set to
| |
| toArray | back to summary |
|---|---|
| private int[] toArray(int val) | |
| toCidrNotation | back to summary |
|---|---|
| private String toCidrNotation(String addr, String mask) | |
| toInteger | back to summary |
|---|---|
| private int toInteger(String address) | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| public int | |
| private int | |
| public String | |
| public int | |
| public String[] | |
| public String | |
| public String | |
| public String | Returns: the IP address in dotted format, may be "0.0.0.0" if there is no valid addressReturn the high address as a dotted IP address. |
| public String | Returns: the IP address in dotted format, may be "0.0.0.0" if there is no valid addressReturn the low address as a dotted IP address. |
| public String | |
| public String | |
| private int | |
| public boolean | |
| private boolean | |
| private int | |
| private int | |
| private int | |
| public String |
| SubnetInfo | back to summary |
|---|---|
| private SubnetInfo() | |
| address | back to summary |
|---|---|
| private int address() | |
| asInteger | back to summary |
|---|---|
| public int asInteger(String address) | |
| broadcast | back to summary |
|---|---|
| private int broadcast() | |
| getAddress | back to summary |
|---|---|
| public String getAddress() | |
| getAddressCount | back to summary |
|---|---|
| public int getAddressCount() Get the count of available addresses. Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false.
| |
| getAllAddresses | back to summary |
|---|---|
| public String[] getAllAddresses() | |
| getBroadcastAddress | back to summary |
|---|---|
| public String getBroadcastAddress() | |
| getCidrSignature | back to summary |
|---|---|
| public String getCidrSignature() | |
| getHighAddress | back to summary |
|---|---|
| public String getHighAddress() Return the high address as a dotted IP address. Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false.
| |
| getLowAddress | back to summary |
|---|---|
| public String getLowAddress() Return the low address as a dotted IP address. Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false.
| |
| getNetmask | back to summary |
|---|---|
| public String getNetmask() | |
| getNetworkAddress | back to summary |
|---|---|
| public String getNetworkAddress() | |
| high | back to summary |
|---|---|
| private int high() | |
| isInRange | back to summary |
|---|---|
| public boolean isInRange(String address) Returns true if the parameter
| |
| isInRange | back to summary |
|---|---|
| private boolean isInRange(int address) | |
| low | back to summary |
|---|---|
| private int low() | |
| netmask | back to summary |
|---|---|
| private int netmask() | |
| network | back to summary |
|---|---|
| private int network() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |