Module inet.ipaddr
Package inet.ipaddr
Class IPAddressNetwork<T extends IPAddress,R extends IPAddressSection,E extends IPAddressSection,S extends IPAddressSegment,J extends java.net.InetAddress>
- java.lang.Object
-
- inet.ipaddr.AddressNetwork<S>
-
- inet.ipaddr.IPAddressNetwork<T,R,E,S,J>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
IPv4AddressNetwork
,IPv6AddressNetwork
public abstract class IPAddressNetwork<T extends IPAddress,R extends IPAddressSection,E extends IPAddressSection,S extends IPAddressSegment,J extends java.net.InetAddress> extends AddressNetwork<S>
Represents a network of addresses of a single IP version providing a collection of standard addresses components for that version, such as masks and loopbacks.- Author:
- sfoley
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IPAddressNetwork.HostIDStringAddressGenerator<T extends HostIdentifierString>
Choose a map of your choice to implement a cache of addresses and/or host names.static class
IPAddressNetwork.HostNameGenerator
Choose a map of your choice to implement a cache of host names and resolved addresses.static class
IPAddressNetwork.IPAddressCreator<T extends IPAddress,R extends IPAddressSection,E extends IPAddressSection,S extends IPAddressSegment,J extends java.net.InetAddress>
static class
IPAddressNetwork.IPAddressGenerator
A factory of address strings or host names, which can be particularly useful if you are using your own network, or if you are using your own validation options.static class
IPAddressNetwork.IPAddressStringGenerator
Choose a map of your choice to implement a cache of address strings and their associated addresses.-
Nested classes/interfaces inherited from class inet.ipaddr.AddressNetwork
AddressNetwork.AddressSegmentCreator<S extends AddressSegment>, AddressNetwork.HostIdentifierStringGenerator<T extends HostIdentifierString>, AddressNetwork.PrefixConfiguration
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clearCaches()
IPAddressNetwork.IPAddressCreator<T,R,E,S,J>
getAddressCreator()
T
getHostMask(int networkPrefixLength)
R
getHostMaskSection(int networkPrefixLength)
abstract IPAddress.IPVersion
getIPVersion()
T
getLoopback()
T
getNetworkAddress(int networkPrefixLength)
The network address is the subnet of all address with the same network mask.T
getNetworkMask(int networkPrefixLength)
The tne network mask is a single address with zeros corresponding to the host section of the address.T
getNetworkMask(int networkPrefixLength, boolean withPrefixLength)
R
getNetworkMaskSection(int networkPrefixLength)
static java.lang.String
getPrefixString(int networkPrefixLength)
int
getSegmentHostMask(int segmentPrefixLength)
int
getSegmentNetworkMask(int segmentPrefixLength)
java.lang.String[]
getStandardLoopbackStrings()
boolean
isIPv4()
boolean
isIPv6()
-
Methods inherited from class inet.ipaddr.AddressNetwork
getDefaultPrefixConfiguration, getPrefixConfiguration, setSegmentCaching
-
-
-
-
Method Detail
-
clearCaches
public void clearCaches()
- Overrides:
clearCaches
in classAddressNetwork<S extends IPAddressSegment>
-
isIPv4
public boolean isIPv4()
-
isIPv6
public boolean isIPv6()
-
getIPVersion
public abstract IPAddress.IPVersion getIPVersion()
-
getAddressCreator
public IPAddressNetwork.IPAddressCreator<T,R,E,S,J> getAddressCreator()
- Specified by:
getAddressCreator
in classAddressNetwork<S extends IPAddressSegment>
-
getLoopback
public T getLoopback()
-
getStandardLoopbackStrings
public java.lang.String[] getStandardLoopbackStrings()
-
getSegmentNetworkMask
public int getSegmentNetworkMask(int segmentPrefixLength)
-
getSegmentHostMask
public int getSegmentHostMask(int segmentPrefixLength)
-
getNetworkMask
public T getNetworkMask(int networkPrefixLength)
The tne network mask is a single address with zeros corresponding to the host section of the address. It may or may not include the prefix length of the network.- Parameters:
networkPrefixLength
-- Returns:
-
getNetworkAddress
public T getNetworkAddress(int networkPrefixLength)
The network address is the subnet of all address with the same network mask. For example, 1.2.0.0/16 is a network address when it includes all addresses 1.2.*.*, rather than just being the single address, the mask 1.2.0.0- Parameters:
networkPrefixLength
-- Returns:
-
getNetworkMask
public T getNetworkMask(int networkPrefixLength, boolean withPrefixLength)
-
getNetworkMaskSection
public R getNetworkMaskSection(int networkPrefixLength)
-
getHostMask
public T getHostMask(int networkPrefixLength)
-
getHostMaskSection
public R getHostMaskSection(int networkPrefixLength)
-
getPrefixString
public static java.lang.String getPrefixString(int networkPrefixLength)
-
-