public class IPv4AddressSection extends IPAddressSection
| Modifier and Type | Class and Description |
|---|---|
static class |
IPv4AddressSection.IPv4StringBuilderOptions |
IPAddressSection.IPStringBuilderOptions, IPAddressSection.StringOptions, IPAddressSection.WildcardOptionsIPAddressSegmentGrouping.Range, IPAddressSegmentGrouping.RangeList| Constructor and Description |
|---|
IPv4AddressSection(byte[] bytes) |
IPv4AddressSection(byte[] bytes,
java.lang.Integer prefix) |
IPv4AddressSection(IPv4AddressSegment[] segments) |
IPv4AddressSection(IPv4AddressSegment[] segments,
java.lang.Integer networkPrefixLength) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(IPAddressSection other) |
boolean |
equals(java.lang.Object o) |
int |
getBitsPerSegment() |
int |
getByteIndex(java.lang.Integer networkPrefixLength) |
int |
getBytesPerSegment() |
IPv4AddressSection |
getHostSection(int networkPrefixLength) |
IPAddress.IPVersion |
getIPVersion() |
IPv4AddressSection |
getLowerSection()
If this represents an address section with ranging values, returns an address section representing the lower values of the range
If this represents an address section with a single value in each segment, returns this.
|
IPv4AddressSegment[] |
getLowerSegments()
If this represents an address section with ranging values, returns an array of address segments representing the lower values of the range
If this represents an address section with a single value in each segment, returns an array containing the segments for this section.
|
IPv4AddressNetwork |
getNetwork() |
IPv4AddressSection |
getNetworkSection(int networkPrefixLength) |
IPv4AddressSection |
getNetworkSection(int networkPrefixLength,
boolean withPrefixLength) |
IPAddressPart[] |
getParts(IPAddressSection.IPStringBuilderOptions options)
Get all representations of this address including this IPAddressSection.
|
IPAddressPart[] |
getParts(IPv4AddressSection.IPv4StringBuilderOptions options) |
IPv4AddressSegment |
getSegment(int index) |
int |
getSegmentIndex(java.lang.Integer networkPrefixLength) |
IPv4AddressSegment[] |
getSegments() |
IPv4AddressSection |
getUpperSection()
If this represents an address section with ranging values, returns an address section representing the upper values of the range
If this represents an address section with a single value in each segment, returns this.
|
IPv4AddressSegment[] |
getUpperSegments()
If this represents an address section with ranging values, returns an an array of address segments representing the upper values of the rang
If this represents an address section with a single value in each segment, returns an array containing the segments for this section.
|
boolean |
isIPv4() |
java.util.Iterator<IPv4AddressSegment[]> |
iterator() |
java.util.Iterator<IPv4AddressSection> |
sectionIterator() |
IPv4AddressSection[] |
subtract(IPAddressSection other)
Subtract the give subnet from this subnet, returning an array of sections for the result (the subnets will not be contiguous so an array is required).
|
IPAddressPartStringCollection |
toAllStringCollection()
Use this method with care...
|
java.lang.String |
toCanonicalString()
This produces a canonical string.
|
java.lang.String |
toCanonicalWildcardString()
This produces a string similar to the canonical string and avoids the CIDR prefix.
|
java.lang.String |
toCompressedString()
The shortest string for IPv4 addresses is the same as the canonical string.
|
java.lang.String |
toCompressedWildcardString()
This is similar to toNormalizedWildcardString, avoiding the CIDR prefix, but with compression as well.
|
IPAddressPartStringCollection |
toDatabaseSearchStringCollection()
Returns a set of strings for search the standard string representations in a database
-compress the largest compressible segments or no compression (a:0:0:c:d:0:e:f or a::c:d:0:e:f)
-upper/lowercase is not considered because many databases are case-insensitive
|
java.lang.String |
toFullString()
This produces a string with no compressed segments and all segments of full length,
which is 3 characters for IPv4 segments.
|
java.lang.String |
toInetAtonString(IPv4Address.inet_aton_radix radix) |
java.lang.String |
toInetAtonString(IPv4Address.inet_aton_radix radix,
int joinedCount) |
IPAddressSegmentGrouping |
toJoinedSegments(int joinCount) |
java.lang.String |
toNetworkPrefixLengthString()
Returns a string with a CIDR prefix length if this section has a network prefix length.
|
java.lang.String |
toNormalizedString()
The normalized string returned by this method is consistent with java.net.Inet4Address,
and is the same as the canonical string.
|
java.lang.String |
toNormalizedString(IPAddressSection.StringOptions stringParams,
int joinCount) |
java.lang.String |
toNormalizedWildcardString()
This produces a string similar to the normalized string and avoids the CIDR prefix.
|
java.lang.String |
toSQLWildcardString()
This is the same as the string from toNormalizedWildcardString except that:
-it uses IPAddress.SEGMENT_SQL_WILDCARD instead of IPAddress.SEGMENT_WILDCARD
-it uses IPAddress.SEGMENT_SQL_SINGLE_WILDCARD
|
IPAddressPartStringCollection |
toStandardStringCollection()
Returns at most a couple dozen string representations:
-mixed (1:2:3:4:5:6:1.2.3.4)
-upper and lower case
-full compressions or no compression (a:0:0:c:d:0:e:f or a::c:d:0:e:f or a:0:b:c:d::e:f)
-full leading zeros (000a:0000:000b:000c:000d:0000:000e:000f)
-combinations thereof
|
IPAddressPartStringCollection |
toStringCollection(IPAddressSection.IPStringBuilderOptions opts) |
IPAddressPartStringCollection |
toStringCollection(IPv4AddressSection.IPv4StringBuilderOptions opts) |
IPv4AddressSection |
toSubnet(int networkPrefixLength)
Creates a subnet address using the given CIDR prefix bits.
|
IPv4AddressSection |
toSubnet(IPAddressSection mask)
Creates a subnet address using the given mask.
|
IPv4AddressSection |
toSubnet(IPAddressSection mask,
java.lang.Integer networkPrefixLength)
Creates a subnet address using the given mask and prefix length.
|
java.lang.String |
toSubnetString()
Produces a consistent subnet string.
|
bitsPerSegment, bytesPerSegment, copySegments, getBitCount, getByteCount, getBytes, getEquivalentPrefix, getHostBits, getLowestBytes, getMaskPrefixLength, getMinPrefix, getSegmentCount, getSegmentPrefixLength, getSegmentPrefixLength, getSegmentStrings, getStartsWithSQLClause, getStartsWithSQLClause, isContainedBy, isDecimalSameAsOctal, isEntireAddress, isIPv6, isMaskCompatibleWithRange, toHexString, toMinimalPrefixed, toNormalizedString, toNormalizedString, toPrefixedEquivalent, toString, toSupernet, toSupernetcompareTo, getCount, getDivision, getDivisionCount, getNetworkPrefixLength, getZeroRangeSegments, getZeroSegments, hashCode, isMultiple, isMultipleByNetworkPrefix, isPrefixed, isRangeEquivalentToPrefix, isZerogetPrefixStringLengthpublic IPv4AddressSection(IPv4AddressSegment[] segments, java.lang.Integer networkPrefixLength)
public IPv4AddressSection(IPv4AddressSegment[] segments)
public IPv4AddressSection(byte[] bytes,
java.lang.Integer prefix)
public IPv4AddressSection(byte[] bytes)
public IPv4AddressSegment[] getSegments()
getSegments in class IPAddressSectionpublic IPv4AddressSegment[] getLowerSegments()
IPAddressSectiongetLowerSegments in class IPAddressSectionpublic IPv4AddressSegment[] getUpperSegments()
IPAddressSectiongetUpperSegments in class IPAddressSectionpublic IPv4AddressSection getLowerSection()
IPAddressSectiongetLowerSection in class IPAddressSectionpublic IPv4AddressSection getUpperSection()
IPAddressSectiongetUpperSection in class IPAddressSectionpublic java.util.Iterator<IPv4AddressSection> sectionIterator()
sectionIterator in class IPAddressSectionpublic java.util.Iterator<IPv4AddressSegment[]> iterator()
iterator in class IPAddressSectionpublic IPv4AddressSegment getSegment(int index)
getSegment in class IPAddressSectionpublic int getBitsPerSegment()
getBitsPerSegment in class IPAddressSectionpublic int getBytesPerSegment()
getBytesPerSegment in class IPAddressSectionpublic boolean isIPv4()
isIPv4 in class IPAddressSectionpublic IPAddress.IPVersion getIPVersion()
getIPVersion in class IPAddressSectionpublic boolean equals(java.lang.Object o)
equals in class IPAddressSegmentGroupingpublic boolean contains(IPAddressSection other)
contains in class IPAddressSectionpublic IPv4AddressSection[] subtract(IPAddressSection other)
IPAddressSectionsubtract in class IPAddressSectionpublic int getByteIndex(java.lang.Integer networkPrefixLength)
getByteIndex in class IPAddressSectionpublic int getSegmentIndex(java.lang.Integer networkPrefixLength)
getSegmentIndex in class IPAddressSectionpublic IPv4AddressNetwork getNetwork()
getNetwork in class IPAddressSectionpublic IPv4AddressSection toSubnet(int networkPrefixLength) throws IPAddressTypeException
IPAddressSectiontoSubnet in class IPAddressSectionIPAddressTypeExceptionpublic IPv4AddressSection toSubnet(IPAddressSection mask) throws IPAddressTypeException
toSubnet in class IPAddressSectionIPAddressTypeExceptionpublic IPv4AddressSection toSubnet(IPAddressSection mask, java.lang.Integer networkPrefixLength) throws IPAddressTypeException
toSubnet in class IPAddressSectionnetworkPrefixLength - if non-null, applies the given prefixIPAddressTypeException - if the mask is not compatible, see IPAddress.isMaskCompatibleWithRange(IPAddress, Integer)public IPv4AddressSection getNetworkSection(int networkPrefixLength)
getNetworkSection in class IPAddressSectionpublic IPv4AddressSection getNetworkSection(int networkPrefixLength, boolean withPrefixLength)
getNetworkSection in class IPAddressSectionpublic IPv4AddressSection getHostSection(int networkPrefixLength)
getHostSection in class IPAddressSectionpublic java.lang.String toCanonicalString()
toCanonicalString in class IPAddressSectionpublic java.lang.String toFullString()
toFullString in class IPAddressSectionpublic java.lang.String toCompressedString()
toCompressedString in class IPAddressSectionpublic java.lang.String toNormalizedString()
toNormalizedString in class IPAddressSectionpublic java.lang.String toCompressedWildcardString()
IPAddressSectiontoCompressedWildcardString in class IPAddressSectionpublic java.lang.String toSubnetString()
IPAddressSectiontoSubnetString in class IPAddressSectionpublic java.lang.String toNetworkPrefixLengthString()
IPAddressSectiontoNetworkPrefixLengthString in class IPAddressSectionpublic java.lang.String toInetAtonString(IPv4Address.inet_aton_radix radix)
public java.lang.String toInetAtonString(IPv4Address.inet_aton_radix radix, int joinedCount)
public java.lang.String toNormalizedWildcardString()
IPAddressSectiontoNormalizedWildcardString in class IPAddressSectionpublic java.lang.String toCanonicalWildcardString()
IPAddressSectiontoCanonicalWildcardString in class IPAddressSectionpublic java.lang.String toSQLWildcardString()
IPAddressSectiontoSQLWildcardString in class IPAddressSectionpublic java.lang.String toNormalizedString(IPAddressSection.StringOptions stringParams, int joinCount)
public IPAddressSegmentGrouping toJoinedSegments(int joinCount)
public IPAddressPartStringCollection toAllStringCollection()
IPAddressSectiontoAllStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toStandardStringCollection()
IPAddressSectiontoStandardStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toDatabaseSearchStringCollection()
IPAddressSectiontoDatabaseSearchStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toStringCollection(IPAddressSection.IPStringBuilderOptions opts)
toStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toStringCollection(IPv4AddressSection.IPv4StringBuilderOptions opts)
public IPAddressPart[] getParts(IPAddressSection.IPStringBuilderOptions options)
IPAddressSectiongetParts in class IPAddressSectionpublic IPAddressPart[] getParts(IPv4AddressSection.IPv4StringBuilderOptions options)