类 IPRange
java.lang.Object
com.alibaba.druid.support.http.util.IPRange
This class represents an IP Range, which are represented by an IP address and and a subnet mask. The standards
describing modern routing protocols often refer to the extended-network-prefix-length rather than the subnet mask.
The prefix length is equal to the number of contiguous one-bits in the traditional subnet mask. This means that
specifying the network address 130.5.5.25 with a subnet mask of 255.255.255.0 can also be expressed as 130.5.5.25/24.
The prefix-length notation is more compact and easier to understand than writing out the mask in its traditional
dotted-decimal format.
- 版本:
- 1.0
- 作者:
- Marcel Dullaart
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final intReturn the extended extended network prefix.final IPAddressReturn the encapsulated IP address.final IPAddressReturn the encapsulated subnet maskbooleanisIPAddressInRange(IPAddress address) Check if the specified IP address is in the encapsulated range.static StringtoDecimalString(String inBinaryIpAddress) toString()Convert the IP Range into a string representation.
-
构造器详细资料
-
IPRange
-
-
方法详细资料
-
getIPAddress
Return the encapsulated IP address.- 返回:
- The IP address.
-
getIPSubnetMask
Return the encapsulated subnet mask- 返回:
- The IP range's subnet mask.
-
getExtendedNetworkPrefix
public final int getExtendedNetworkPrefix()Return the extended extended network prefix.- 返回:
- Return the extended network prefix.
-
toString
Convert the IP Range into a string representation. -
toDecimalString
-
isIPAddressInRange
Check if the specified IP address is in the encapsulated range.- 参数:
address- The IP address to be tested.- 返回:
- Return
trueif the specified IP address is in the encapsulated IP range, otherwise returnfalse.
-