public class IPv4AddressSection extends IPAddressSection implements java.lang.Iterable<IPv4AddressSection>
| Modifier and Type | Class and Description |
|---|---|
static class |
IPv4AddressSection.IPv4StringBuilderOptions |
static class |
IPv4AddressSection.IPv4StringOptions
Represents a clear way to create a specific type of string.
|
IPAddressSection.IPStringBuilderOptions, IPAddressSection.IPStringOptions, IPAddressSection.SegFunction<R,S>, IPAddressSection.WildcardOptionsIPAddressDivisionGrouping.Range, IPAddressDivisionGrouping.RangeListAddressDivisionGrouping.StringOptions| Constructor and Description |
|---|
IPv4AddressSection(Address.SegmentValueProvider lowerValueProvider,
Address.SegmentValueProvider upperValueProvider) |
IPv4AddressSection(Address.SegmentValueProvider lowerValueProvider,
Address.SegmentValueProvider upperValueProvider,
java.lang.Integer prefix) |
IPv4AddressSection(byte[] bytes) |
IPv4AddressSection(byte[] bytes,
java.lang.Integer prefix) |
IPv4AddressSection(int value) |
IPv4AddressSection(int value,
java.lang.Integer prefix) |
IPv4AddressSection(IPv4AddressSegment segment)
Constructs a single segment section.
|
IPv4AddressSection(IPv4AddressSegment[] segments) |
IPv4AddressSection(IPv4AddressSegment[] segments,
java.lang.Integer networkPrefixLength) |
| Modifier and Type | Method and Description |
|---|---|
IPv4AddressSection |
adjustPrefixBySegment(boolean nextSegment)
Increases or decreases prefix length to the next segment boundary.
|
IPv4AddressSection |
adjustPrefixLength(int adjustment)
Increases or decreases prefix length by the given increment.
|
IPv4AddressSection |
append(IPv4AddressSection other) |
IPv4AddressSection |
applyPrefixLength(int networkPrefixLength)
Applies the given network prefix bit length.
|
IPv4AddressSection |
bitwiseOr(IPv4AddressSection mask)
Does the bitwise disjunction with this address.
|
IPv4AddressSection |
bitwiseOrNetwork(IPv4AddressSection mask,
int networkPrefixLength)
Does the bitwise disjunction with this address.
|
boolean |
contains(AddressSection other)
Determines if one section contains another.
|
boolean |
equals(java.lang.Object o) |
int |
getBitsPerSegment() |
int |
getByteIndex(int networkPrefixLength) |
int |
getBytesPerSegment() |
IPv4AddressSection |
getHostSection(int networkPrefixLength) |
IPAddress.IPVersion |
getIPVersion() |
java.lang.Iterable<IPv4AddressSection> |
getIterable()
Useful for using an instance in a "for-each loop".
|
IPv4AddressSection |
getLower()
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.
|
IPv4AddressNetwork |
getNetwork() |
IPv4AddressSection |
getNetworkSection(int networkPrefixLength) |
IPv4AddressSection |
getNetworkSection(int networkPrefixLength,
boolean withPrefixLength) |
IPAddressStringDivisionSeries[] |
getParts(IPAddressSection.IPStringBuilderOptions options)
Get all representations of this address including this IPAddressSection.
|
IPAddressStringDivisionSeries[] |
getParts(IPv4AddressSection.IPv4StringBuilderOptions options) |
IPv4AddressSection |
getSection(int index)
Gets the subsection from the series starting from the given index
|
IPv4AddressSection |
getSection(int index,
int endIndex)
Gets the subsection from the series starting from the given index and ending just before the give endIndex
|
IPv4AddressSegment |
getSegment(int index) |
int |
getSegmentIndex(int networkPrefixLength) |
IPv4AddressSegment[] |
getSegments() |
void |
getSegments(java.util.Collection<? super IPv4AddressSegment> segs) |
void |
getSegments(int start,
int end,
java.util.Collection<? super IPv4AddressSegment> segs) |
IPv4AddressSection |
getUpper()
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.
|
boolean |
isIPv4() |
java.util.Iterator<IPv4AddressSection> |
iterator()
An address component can represent a single segment, address, or section, or it can represent multiple,
typically a subnet or range of segment, address, or section values.
|
IPv4AddressSection |
mask(IPv4AddressSection mask) |
IPv4AddressSection |
maskNetwork(IPv4AddressSection mask,
int networkPrefixLength)
Applies the given mask to the network section of the address as indicated by the given prefix length.
|
IPv4AddressSection |
prepend(IPv4AddressSection other) |
IPv4AddressSection |
removePrefixLength()
Removes the prefix.
|
IPv4AddressSection |
removePrefixLength(boolean zeroed) |
IPv4AddressSection |
replace(IPv4AddressSection other,
int index) |
IPv4AddressSection |
reverseBits(boolean perByte)
Returns a new segment series with the bits reversed.
|
IPv4AddressSection |
reverseBytes()
Returns a new segment series with the bytes reversed.
|
IPv4AddressSection |
reverseBytesPerSegment()
Returns a new segment series with the bytes reversed within each segment.
|
IPv4AddressSection |
reverseSegments()
Returns a new segment series with the segments reversed.
|
java.util.Iterator<IPv4AddressSegment[]> |
segmentsIterator() |
IPv4AddressSection |
setPrefixLength(int networkPrefixLength)
Sets the prefix length.
|
IPv4AddressSection |
setPrefixLength(int networkPrefixLength,
boolean withZeros) |
IPv4AddressSection[] |
subtract(IPv4AddressSection 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) |
IPAddressDivisionGrouping |
toJoinedSegments(int joinCount) |
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.IPStringOptions stringParams,
int joinCount) |
java.lang.String |
toNormalizedWildcardString()
This produces a string similar to the normalized string and avoids the CIDR prefix.
|
java.lang.String |
toPrefixLengthString()
Returns a string with a CIDR prefix length if this section has a network prefix length.
|
java.lang.String |
toReverseDNSLookupString()
Generates the reverse DNS lookup string
For 8.255.4.4 it is 4.4.255.8.in-addr.arpa
For 2001:db8::567:89ab it is b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa
|
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) |
java.lang.String |
toSubnetString()
Produces a consistent subnet string.
|
bitsPerSegment, bytesPerSegment, contains, getBitCount, getByteCount, getEquivalentPrefix, getHostBits, getMaskPrefixLength, getMinPrefix, getSegmentCount, getSegmentPrefixLength, getSegmentPrefixLength, getSegments, getSegments, getSegmentStrings, getStartsWithSQLClause, getStartsWithSQLClause, isEntireAddress, isFullRange, isIPv6, isMaskCompatibleWithRange, toBinaryString, toHexString, toMinPrefixedEquivalent, toNormalizedString, toNormalizedString, toOctalString, toPrefixedEquivalent, toStringgetDivision, getNetworkPrefixLength, getPrefixLength, getZeroRangeSegments, getZeroSegments, isMore, isMultipleByNetworkPrefix, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefixcompareTo, getBytes, getBytes, getCount, getDivisionCount, getUpperBytes, getUpperBytes, hashCode, isMultiple, isRangeEquivalent, isZerogetDivision, getPrefixLength, isMore, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefixgetDivisionCountgetBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isMultiple, isZeropublic IPv4AddressSection(IPv4AddressSegment[] segments, java.lang.Integer networkPrefixLength)
segments - an array containing the segments. Segments that are entirely part of the host section need not be provided, although the array must be the correct length.networkPrefixLength - public IPv4AddressSection(IPv4AddressSegment[] segments)
public IPv4AddressSection(IPv4AddressSegment segment)
segment - public IPv4AddressSection(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, java.lang.Integer prefix)
public IPv4AddressSection(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider)
public IPv4AddressSection(int value,
java.lang.Integer prefix)
public IPv4AddressSection(int value)
public IPv4AddressSection(byte[] bytes,
java.lang.Integer prefix)
public IPv4AddressSection(byte[] bytes)
public IPv4AddressSegment[] getSegments()
getSegments in interface AddressSegmentSeriesgetSegments in class IPAddressSectionpublic IPv4AddressSection getSection(int index)
AddressSegmentSeriesgetSection in interface AddressSectiongetSection in interface AddressSegmentSeriesgetSection in class IPAddressSectionpublic IPv4AddressSection getSection(int index, int endIndex)
AddressSegmentSeriesgetSection in interface AddressSectiongetSection in interface AddressSegmentSeriesgetSection in class IPAddressSectionpublic IPv4AddressSection getLower()
IPAddressSectiongetLower in interface AddressComponentgetLower in interface AddressSectiongetLower in interface AddressSegmentSeriesgetLower in class IPAddressSectionpublic IPv4AddressSection getUpper()
IPAddressSectiongetUpper in interface AddressComponentgetUpper in interface AddressSectiongetUpper in interface AddressSegmentSeriesgetUpper in class IPAddressSectionpublic IPv4AddressSection reverseBits(boolean perByte)
AddressSegmentSeriesreverseBits in interface AddressComponentreverseBits in interface AddressSectionreverseBits in interface AddressSegmentSeriesreverseBits in class IPAddressSectionperByte - if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedpublic IPv4AddressSection reverseBytes()
AddressSegmentSeriesreverseBytes in interface AddressComponentreverseBytes in interface AddressSectionreverseBytes in interface AddressSegmentSeriesreverseBytes in class IPAddressSectionpublic IPv4AddressSection reverseBytesPerSegment()
AddressSegmentSeriesreverseBytesPerSegment in interface AddressSectionreverseBytesPerSegment in interface AddressSegmentSeriesreverseBytesPerSegment in class IPAddressSectionpublic IPv4AddressSection reverseSegments()
AddressSegmentSeriesreverseSegments in interface AddressSectionreverseSegments in interface AddressSegmentSeriesreverseSegments in class IPAddressSectionpublic java.lang.Iterable<IPv4AddressSection> getIterable()
AddressComponentAddressComponent.iterator() directly.getIterable in interface AddressComponentgetIterable in interface AddressSectiongetIterable in interface AddressSegmentSeriesgetIterable in class IPAddressSectionpublic java.util.Iterator<IPv4AddressSection> iterator()
AddressComponentAddressItem.isMultiple() to determine if this instance represents multiple.
This method iterates through the individual elements.iterator in interface AddressComponentiterator in interface AddressSectioniterator in interface AddressSegmentSeriesiterator in interface java.lang.Iterable<IPv4AddressSection>iterator in class IPAddressSectionpublic java.util.Iterator<IPv4AddressSegment[]> segmentsIterator()
segmentsIterator in interface AddressSegmentSeriessegmentsIterator in class IPAddressSectionpublic IPv4AddressSegment getSegment(int index)
getSegment in interface AddressSegmentSeriesgetSegment in class IPAddressSectionpublic void getSegments(java.util.Collection<? super IPv4AddressSegment> segs)
public void getSegments(int start,
int end,
java.util.Collection<? super IPv4AddressSegment> segs)
public int getBitsPerSegment()
getBitsPerSegment in interface AddressSegmentSeriespublic int getBytesPerSegment()
getBytesPerSegment in interface AddressSegmentSeriespublic boolean isIPv4()
isIPv4 in class IPAddressSectionpublic IPAddress.IPVersion getIPVersion()
getIPVersion in class IPAddressSectionpublic boolean equals(java.lang.Object o)
equals in class IPAddressDivisionGroupingpublic IPv4AddressSection replace(IPv4AddressSection other, int index)
public IPv4AddressSection prepend(IPv4AddressSection other)
public IPv4AddressSection append(IPv4AddressSection other)
public boolean contains(AddressSection other)
AddressSectioncontains in interface AddressSectionpublic IPv4AddressSection[] subtract(IPv4AddressSection other)
other - AddressTypeException - if the two sections are not comparablepublic int getByteIndex(int networkPrefixLength)
getByteIndex in class IPAddressSectionpublic int getSegmentIndex(int networkPrefixLength)
getSegmentIndex in class IPAddressSectionpublic IPv4AddressNetwork getNetwork()
getNetwork in class IPAddressSectionpublic IPv4AddressSection adjustPrefixBySegment(boolean nextSegment)
AddressSegmentSeriesadjustPrefixBySegment in interface AddressSectionadjustPrefixBySegment in interface AddressSegmentSeriesadjustPrefixBySegment in class IPAddressSectionpublic IPv4AddressSection adjustPrefixLength(int adjustment)
AddressSegmentSeriesadjustPrefixLength in interface AddressSectionadjustPrefixLength in interface AddressSegmentSeriesadjustPrefixLength in class IPAddressSectionpublic IPv4AddressSection applyPrefixLength(int networkPrefixLength)
IPAddressSectionapplyPrefixLength in interface AddressSectionapplyPrefixLength in interface AddressSegmentSeriesapplyPrefixLength in class IPAddressSectionpublic IPv4AddressSection setPrefixLength(int networkPrefixLength)
AddressSegmentSeriessetPrefixLength in interface AddressSectionsetPrefixLength in interface AddressSegmentSeriessetPrefixLength in class IPAddressSectionpublic IPv4AddressSection setPrefixLength(int networkPrefixLength, boolean withZeros)
setPrefixLength in class IPAddressSectionpublic IPv4AddressSection bitwiseOrNetwork(IPv4AddressSection mask, int networkPrefixLength) throws AddressTypeException
mask - AddressTypeExceptionpublic IPv4AddressSection bitwiseOr(IPv4AddressSection mask) throws AddressTypeException
mask - AddressTypeExceptionpublic IPv4AddressSection removePrefixLength()
AddressSegmentSeriesremovePrefixLength in interface AddressSectionremovePrefixLength in interface AddressSegmentSeriesremovePrefixLength in class IPAddressSectionpublic IPv4AddressSection removePrefixLength(boolean zeroed)
removePrefixLength in class IPAddressSectionpublic IPv4AddressSection mask(IPv4AddressSection mask) throws AddressTypeException
AddressTypeExceptionpublic IPv4AddressSection maskNetwork(IPv4AddressSection mask, int networkPrefixLength) throws AddressTypeException
bitwiseOr(IPv4AddressSection) or replace(IPv4AddressSection, int)mask - networkPrefixLength - AddressTypeExceptionpublic 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 interface AddressSegmentSeriespublic java.lang.String toFullString()
toFullString in class IPAddressSectionpublic java.lang.String toCompressedString()
toCompressedString in interface AddressSegmentSeriestoCompressedString in class IPAddressSectionpublic java.lang.String toNormalizedString()
toNormalizedString in interface AddressComponentpublic java.lang.String toCompressedWildcardString()
IPAddressSectiontoCompressedWildcardString in class IPAddressSectionpublic java.lang.String toSubnetString()
IPAddressSectiontoSubnetString in class IPAddressSectionpublic java.lang.String toPrefixLengthString()
IPAddressSectiontoPrefixLengthString 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 toReverseDNSLookupString()
IPAddressSectiontoReverseDNSLookupString in class IPAddressSectionpublic java.lang.String toNormalizedString(IPAddressSection.IPStringOptions stringParams, int joinCount)
public IPAddressDivisionGrouping 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 IPAddressStringDivisionSeries[] getParts(IPAddressSection.IPStringBuilderOptions options)
IPAddressSectionIPAddressDivisionGroupinggetParts in class IPAddressSectionpublic IPAddressStringDivisionSeries[] getParts(IPv4AddressSection.IPv4StringBuilderOptions options)