- All Implemented Interfaces:
AddressComponent
,AddressSection
,AddressSegmentSeries
,AddressComponentRange
,AddressDivisionSeries
,AddressItem
,AddressItemRange
,IPAddressDivisionSeries
,AddressStringDivisionSeries
,IPAddressStringDivisionSeries
,IPAddressSegmentSeries
,Serializable
,Comparable<AddressItem>
,Iterable<IPv6AddressSection>
- Author:
- sfoley
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
Provides a clear way to create a specific type of string.static class
Nested classes/interfaces inherited from class inet.ipaddr.IPAddressSection
IPAddressSection.IPStringBuilderOptions, IPAddressSection.IPStringOptions, IPAddressSection.SegFunction<R,
S>, IPAddressSection.SeriesCreator, IPAddressSection.TriFunction<R, S>, IPAddressSection.WildcardOptions Nested classes/interfaces inherited from class inet.ipaddr.format.standard.IPAddressDivisionGrouping
IPAddressDivisionGrouping.Range, IPAddressDivisionGrouping.RangeList
Nested classes/interfaces inherited from class inet.ipaddr.format.standard.AddressDivisionGrouping
AddressDivisionGrouping.DivisionLengthProvider, AddressDivisionGrouping.DivisionValueProvider, AddressDivisionGrouping.StringOptions
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIPv6AddressSection
(byte[] bytes) IPv6AddressSection
(byte[] bytes, int byteStartIndex, int byteEndIndex) IPv6AddressSection
(byte[] bytes, int byteStartIndex, int byteEndIndex, Integer prefix) IPv6AddressSection
(byte[] bytes, Integer prefix) IPv6AddressSection
(long highBytes, long lowBytes, int segmentCount) IPv6AddressSection
(long highBytes, long lowBytes, int segmentCount, Integer networkPrefixLength) IPv6AddressSection
(Address.SegmentValueProvider valueProvider, int segmentCount) IPv6AddressSection
(Address.SegmentValueProvider valueProvider, int segmentCount, Integer networkPrefixLength) IPv6AddressSection
(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, int segmentCount) IPv6AddressSection
(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, int segmentCount, Integer networkPrefixLength) IPv6AddressSection
(IPv6AddressSegment segment) Constructs a single segment section, the segment being the leading segment.IPv6AddressSection
(IPv6AddressSegment[] segments) Use this constructor for any address section that includes the leading segment of an IPv6 addressIPv6AddressSection
(IPv6AddressSegment[] segments, int startIndex, Integer networkPrefixLength) IPv6AddressSection
(IPv6AddressSegment[] segments, Integer networkPrefixLength) Use this constructor for any address section that includes the leading segment of an IPv6 addressIPv6AddressSection
(IPv6AddressSegment segment, int startIndex) Constructs a single segment section with the segment at the given index in the address.Constructs the corresponding IPv6 address section from a modified EUI-64 (Extended Unique Identifier) address.Constructs the corresponding IPv6 address section from a modified EUI-64 (Extended Unique Identifier) address section.IPv6AddressSection
(BigInteger val, int segmentCount) IPv6AddressSection
(BigInteger val, int segmentCount, Integer networkPrefixLength) -
Method Summary
Modifier and TypeMethodDescriptionadjustPrefixBySegment
(boolean nextSegment) Increases or decreases prefix length to the next segment boundary.adjustPrefixBySegment
(boolean nextSegment, boolean zeroed) Increases or decreases prefix length to the next segment boundary.adjustPrefixLength
(int adjustment) Increases or decreases prefix length by the given increment.adjustPrefixLength
(int adjustment, boolean zeroed) Increases or decreases prefix length by the given increment.append
(IPv6AddressSection other) applyPrefixLength
(int networkPrefixLength) Deprecated.Constructs an equivalent address section with the smallest CIDR prefix possible (largest network), such that the range of values are a set of subnet blocks for that prefix.Returns the equivalent CIDR address section with a prefix length for which the subnet block for that prefix matches the range of values in this section.bitwiseOr
(IPv6AddressSection mask) Equivalent tobitwiseOr(IPv6AddressSection, boolean)
with the second argument as false.bitwiseOr
(IPv6AddressSection mask, boolean retainPrefix) Does the bitwise disjunction with this address.bitwiseOrNetwork
(IPv6AddressSection mask, int networkPrefixLength) Does the bitwise disjunction with this address.blockIterator
(int segmentCount) Iterates through series that can be obtained by iterating through all the upper segments up to the given segment count.blockSpliterator
(int segmentCount) Partitions and traverses through the individual sequential blocks created from each of the individual values up to the given segment count.blockStream
(int segmentCount) Returns a sequential stream of the individual blocks created from each of the individual values up to the given segment count.boolean
contains
(AddressSection other) Determines if one section contains another.Returns the minimal-size prefix block that covers all the values in this series.static IPv6AddressSection
createSection
(IPv6AddressNetwork.IPv6AddressCreator creator, IPv6AddressSegment[] nonMixedSection, IPv4Address mixedSection) boolean
Two groupings are equal if: - they match type/version (ipv4, ipv6, mac, or a specific grouping class) - they match division counts - each division matches bit counts - each division matches their specific grouping class - each division matches values Prefix lengths, for those groupings and/or divisionsS that have them, are ignored.int
Provides the number of bits comprising this address itemint
Returns the number of bits comprising each segment in this series.int
Provides the number of bytes required for this address item, rounding up if the bit count is not a multiple of 8int
Returns the number of bytes comprising each segment in this series.getDivision
(int index) Gets the IPv4 section corresponding to the lowest (least-significant) 4 bytes in the original address, which will correspond to between 0 and 4 bytes in this address.getEmbeddedIPv4AddressSection
(int startIndex, int endIndex) Produces an IPv4 address section from any sequence of bytes in this IPv6 address sectionReturns the host mask associated with the CIDR network prefix length of this series.Returns the host section of the series.getHostSection
(int networkPrefixLength) Returns the host section of the address as indicated by the network prefix length provided.getIPv6Address
(IPv4Address mixedSection) Create an IPv6 mixed address using the given address for the embedded IPv4 segmentsReturns the version of this segment seriesUseful for using an instance in a "for-each loop".getLower()
If this represents a series with ranging values, returns a series representing the lower values of the range.Similar toIPAddressSegmentSeries.getLower()
, but will not return a series that has a prefix length and whose host value is zero.static BigInteger
getMaxValue
(int segmentCount) Returns the network object for components of the same version (eg IPv4, IPv6 and MAC each have their own network object)Returns the network mask associated with the CIDR network prefix length of this series.Returns the network section of the series if the series has a CIDR network prefix length, otherwise it returns the entire series as a prefixed series with prefix matching the address bit length.getNetworkSection
(int networkPrefixLength) Returns the network section of the series.getNetworkSection
(int networkPrefixLength, boolean withPrefixLength) Returns the network section of the series.Get all representations of this address including this IPAddressSection.getPrefixCount
(int prefixLength) The count of the number of distinct values within the prefix part of the address item, the bits that appear within the prefix length.Gets the subsection from the series that comprises all segmentsgetSection
(int index) Gets the subsection from the series starting from the given index The first segment is at index 0.getSection
(int index, int endIndex) Gets the subsection from the series starting from the given index and ending just before the give endIndex The first segment is at index 0.getSegment
(int index) Returns the segment from this series at the given index.Returns the segments of this series of segments as an array.void
getSegments
(int start, int end, Collection<? super IPv6AddressSegment> segs) void
getSegments
(Collection<? super IPv6AddressSegment> segs) getUpper()
If this represents a series with ranging values, returns a series representing the upper values of the range If this represents a series with a single value in each segment, returns this.boolean
hasUppercaseVariations
(int base, boolean lowerOnly) Returns whether this subnet or address has alphabetic digits when printed.increment
(long increment) Returns the series from the subnet that is the given increment upwards into the subnet range, with the increment of 0 returning the first address in the range.incrementBoundary
(long increment) If the given increment is positive, adds the value to the upper series (AddressSegmentSeries.getUpper()
) in the subnet range to produce a new series.insert
(int index, IPv6AddressSection other) intersect
(IPv6AddressSection other) Produces the subnet sections whose addresses are found in both this and the given argument.boolean
isEUI64()
Equivalent to isEUI64(false)boolean
isEUI64
(boolean partial) Whether this section is consistent with an EUI64 section, which means it came from an extended 8 byte address, and the corresponding segments in the middle match 0xff and 0xfeboolean
isIPv6()
boolean
isZero()
Returns whether this item matches the value of zeroiterator()
Iterates through the individual address components.mask
(IPv6AddressSection mask) Equivalent tomask(IPv6AddressSection, boolean)
with the second argument as false.mask
(IPv6AddressSection mask, boolean retainPrefix) Does the bitwise conjuction with this address.maskNetwork
(IPv6AddressSection mask, int networkPrefixLength) Applies the given mask to the network section of the address as indicated by the given prefix length.boolean
matchesWithMask
(IPAddressSection other, IPAddressSection mask) Applies the mask to this address section and then compares values with the given address sectionmergePrefixBlocks
(IPv6AddressSection... sections) Deprecated.mergeToPrefixBlocks
(IPv6AddressSection... sections) Merges this with the list of sections to produce the smallest array of prefix blocks.mergeToSequentialBlocks
(IPv6AddressSection... sections) Merges this with the list of sections to produce the smallest array of sequential block subnets, going from smallest to largestSimilar to the iterator, but series with a host of zero are skipped.Iterates through the individual prefix blocks.Partitions and traverses through the individual prefix blocks for the prefix length of this series.Returns a sequential stream of the individual prefix blocks for the prefix length of this series.boolean
Returns whether the prefix of this address contains all values of the same bits in the given address or subnetboolean
Determines if the argument section matches this section up to the prefix length of this section.Iterates through the individual prefixes.Partitions and traverses through the individual prefixes for the prefix length of this series.Returns a sequential stream of the individual prefixes for the prefix length of this series.Deprecated.removePrefixLength
(boolean zeroed) Deprecated.replace
(int startIndex, int endIndex, IPv6AddressSection replacement, int replacementStartIndex, int replacementEndIndex) Replaces segments starting from startIndex and ending before endIndex with the segments starting at replacementStartIndex and ending before replacementEndIndex from the replacement sectionreplace
(int startIndex, int endIndex, IPv6AddressSection replacement, int replacementStartIndex, int replacementEndIndex, boolean appendNetwork) replace
(int index, IPv6AddressSection replacement) Replace the segments of this section starting at the given index with the given replacement segmentsreverseBits
(boolean perByte) Returns a new series which has the bits reversed.Returns a new segment series with the bytes reversed.Returns a new segment series with the bytes reversed within each segment.Returns a new segment series with the segments reversed.Iterates through the individual segments.Similar to the segments iterator, but series with a host of zero are skipped.Partitions and traverses through the individual segment arrays.Returns a sequential stream of the individual segment arrays.Iterates through the sequential series that make up this series.Partitions and traverses through the individual sequential blocks.Returns a sequential stream of the individual sequential blocks.setPrefixLength
(int networkPrefixLength) Sets the prefix length.setPrefixLength
(int networkPrefixLength, boolean withZeros) Sets the prefix length.setPrefixLength
(int networkPrefixLength, boolean withZeros, boolean zeroHostIsBlock) Sets the prefix length while allowing the caller to control whether bits moved in or out of the prefix become zero, and whether a zero host for the new prefix bits can be translated into a prefix block.Produces an array of prefix blocks that spans the same set of values.Produces the list of prefix block subnets that span from this series to the given series.Deprecated.Produces an array of blocks that are sequential that cover the same set of sections as this.Produces a list of range subnets that span from this series to the given series.Partitions and traverses through the individual address components.stream()
Returns a sequential stream of the individual address components.subtract
(IPv6AddressSection 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).Use this method with care...The base 85 string is described by RFC 1924This produces a canonical string.This produces a string similar to the canonical string and avoids the CIDR prefix.This produces the shortest valid string for the address.This is similar to toNormalizedWildcardString, avoiding the CIDR prefix, but with compression as well.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-insensitivetoEUI
(boolean extended) Returns the corresponding mac section, or null if this address section does not correspond to a mac section.This produces a string with no compressed segments and all segments of full length, which is 4 characters for IPv6 segments and 3 characters for IPv4 segments.Returns the segment series with a host of all ones.toMaxHost
(int prefixLength) Produces the series with host values of all one bits for the given prefix length.This produces the mixed IPv6/IPv4 string.The normalized string returned by this method is consistent with java.net.Inet6address.Creates a customized string from this series.static String
toNormalizedString
(IPAddressSection.IPStringOptions options, CharSequence zone, IPAddressStringDivisionSeries part) toNormalizedString
(IPv6AddressSection.IPv6StringOptions options, CharSequence zone) This produces a string similar to the normalized string and avoids the CIDR prefix.If this series has a prefix length, returns the subnet block for that prefix.toPrefixBlock
(int networkPrefixLength) Returns the segment series of the same length that spans all hosts.Returns a string with a CIDR prefix length if this section has a network prefix length.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.arpaWrites this IP address segment series as a segments of binary values preceded by the "0b" prefix.This is the same as the string from toNormalizedWildcardString except that it usesAddress.SEGMENT_SQL_WILDCARD
instead ofAddress.SEGMENT_WILDCARD
and also usesAddress.SEGMENT_SQL_SINGLE_WILDCARD
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 thereofProduces a consistent subnet string.Returns the segment series with a host of zero, the host being the bits following the prefix length.toZeroHost
(int prefixLength) Produces the series with host values of 0 for the given prefix length.Returns the segment series with a network of zero, the network being the bits within the prefix length.Provides the same address with no prefix.Methods inherited from class inet.ipaddr.IPAddressSection
bitsPerSegment, bytesPerSegment, containsNonZeroHosts, containsPrefixBlock, getBlockCount, getBlockMaskPrefixLength, getCountImpl, getMaxSegmentValue, getMinPrefixLengthForBlock, getNonZeroHostCount, getPrefixLengthForSingleBlock, getSegmentCount, getSegments, getSegments, getSegmentStrings, getSequentialBlockCount, getStartsWithSQLClause, getStartsWithSQLClause, includesMaxHost, includesMaxHost, includesZeroHost, includesZeroHost, isEntireAddress, isFullRange, isIPv4, isSingleNetwork, isSinglePrefixBlock, isZeroHost, isZeroHost, toBinaryString, toHexString, toNormalizedString, toOctalString, toString
Methods inherited from class inet.ipaddr.format.standard.IPAddressDivisionGrouping
containsSinglePrefixBlock, getLeadingBitCount, getNetworkPrefixLength, getPrefixLength, getTrailingBitCount, isMore, isPrefixBlock
Methods inherited from class inet.ipaddr.format.standard.AddressDivisionGrouping
hashCode
Methods inherited from class inet.ipaddr.format.AddressDivisionGroupingBase
getBytes, getBytes, getBytes, getCount, getDivisionCount, getDivisionStrings, getPrefixCount, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isMax, isMultiple, isPrefixed
Methods inherited from interface inet.ipaddr.format.AddressDivisionSeries
getCount, getDivisionStrings, getPrefixCount, getPrefixLength, getSequentialBlockIndex, isMore, isPrefixBlock, isPrefixed, isSequential
Methods inherited from interface inet.ipaddr.format.AddressItem
compareTo, containsSinglePrefixBlock, getBytes, getBytes, getBytes, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isMax, isMultiple
Methods inherited from interface inet.ipaddr.AddressSegmentSeries
isOneBit, testBit
Methods inherited from interface inet.ipaddr.format.string.AddressStringDivisionSeries
getDivisionCount
Methods inherited from interface inet.ipaddr.format.IPAddressDivisionSeries
getNetworkPrefixLength
Methods inherited from interface inet.ipaddr.format.string.IPAddressStringDivisionSeries
getPrefixLength, isPrefixBlock, isPrefixed
-
Field Details
-
addressSegmentIndex
public final int addressSegmentIndex
-
-
Constructor Details
-
IPv6AddressSection
Constructs a single segment section, the segment being the leading segment.- Parameters:
segment
-
-
IPv6AddressSection
Constructs a single segment section with the segment at the given index in the address.- Parameters:
segment
-- Throws:
AddressValueException
-
IPv6AddressSection
Use this constructor for any address section that includes the leading segment of an IPv6 address- Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(IPv6AddressSegment[] segments, Integer networkPrefixLength) throws AddressValueException Use this constructor for any address section that includes the leading segment of an IPv6 address- Parameters:
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
-- Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(IPv6AddressSegment[] segments, int startIndex, Integer networkPrefixLength) throws AddressValueException - Parameters:
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.startIndex
- the index of the first segment where this section would be located in a full address, 0 for network sections or full addressesnetworkPrefixLength
-- Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(Address.SegmentValueProvider valueProvider, int segmentCount, Integer networkPrefixLength) throws AddressValueException - Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, int segmentCount, Integer networkPrefixLength) throws AddressValueException - Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(Address.SegmentValueProvider valueProvider, int segmentCount) throws AddressValueException - Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, int segmentCount) -
IPv6AddressSection
public IPv6AddressSection(byte[] bytes, int byteStartIndex, int byteEndIndex, Integer prefix) throws AddressValueException - Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(byte[] bytes, int byteStartIndex, int byteEndIndex) throws AddressValueException - Throws:
AddressValueException
-
IPv6AddressSection
- Throws:
AddressValueException
-
IPv6AddressSection
- Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(BigInteger val, int segmentCount, Integer networkPrefixLength) throws AddressValueException - Throws:
AddressValueException
-
IPv6AddressSection
- Throws:
AddressValueException
-
IPv6AddressSection
public IPv6AddressSection(long highBytes, long lowBytes, int segmentCount, Integer networkPrefixLength) throws PrefixLenException - Throws:
PrefixLenException
-
IPv6AddressSection
public IPv6AddressSection(long highBytes, long lowBytes, int segmentCount) -
IPv6AddressSection
Constructs the corresponding IPv6 address section from a modified EUI-64 (Extended Unique Identifier) address.If the supplied address is an 8 byte EUI-64, then it must match the required EUI-64 format of xx-xx-ff-fe-xx-xx with the ff-fe section in the middle. If the supplied address is a 6 byte MAC-48 or EUI-48, then the ff-fe pattern will be inserted.
The constructor will toggle the MAC U/L (universal/local) bit as required with EUI-64.
Any prefix length in the MAC address is ignored.
- Parameters:
eui
-- Throws:
IncompatibleAddressException
- when the MAC address is an EUI-64 that cannot be converted to an IPv6 address (ff-fe section in middle)
-
IPv6AddressSection
Constructs the corresponding IPv6 address section from a modified EUI-64 (Extended Unique Identifier) address section.If the supplied address section comes from an 8 byte EUI-64, then it must match the required EUI-64 format of xx-xx-ff-fe-xx-xx with the ff-fe section in the middle. If the supplied address section comes from a 6 byte MAC-48 or EUI-48, then the ff-fe pattern will be inserted.
The constructor will toggle the MAC U/L (universal/local) bit as required with EUI-64.
Any prefix length in the MAC address section is ignored.
- Parameters:
eui
-- Throws:
IncompatibleAddressException
- when the MAC address section is an EUI-64 that cannot be converted to an IPv6 address (ff-fe section in middle)
-
-
Method Details
-
getSection
Description copied from interface:AddressSegmentSeries
Gets the subsection from the series that comprises all segments- Specified by:
getSection
in interfaceAddressSegmentSeries
- Specified by:
getSection
in interfaceIPAddressSegmentSeries
- Returns:
-
getSection
Description copied from interface:AddressSegmentSeries
Gets the subsection from the series starting from the given index The first segment is at index 0.- Specified by:
getSection
in interfaceAddressSegmentSeries
- Specified by:
getSection
in interfaceIPAddressSegmentSeries
- Specified by:
getSection
in classIPAddressSection
- Parameters:
index
-- Returns:
-
getSection
Description copied from interface:AddressSegmentSeries
Gets the subsection from the series starting from the given index and ending just before the give endIndex The first segment is at index 0.- Specified by:
getSection
in interfaceAddressSegmentSeries
- Specified by:
getSection
in interfaceIPAddressSegmentSeries
- Specified by:
getSection
in classIPAddressSection
- Parameters:
index
-endIndex
-- Returns:
-
getSegments
Description copied from interface:AddressSegmentSeries
Returns the segments of this series of segments as an array. This must create a new array, so for efficiency useAddressSegmentSeries.getSegment(int)
andAddressSegmentSeries.getSegmentCount()
instead when feasible.- Specified by:
getSegments
in interfaceAddressSegmentSeries
- Specified by:
getSegments
in interfaceIPAddressSegmentSeries
- Returns:
-
getLowerNonZeroHost
Description copied from interface:IPAddressSegmentSeries
Similar toIPAddressSegmentSeries.getLower()
, but will not return a series that has a prefix length and whose host value is zero. If this series has no prefix length, returns the same series asIPAddressSegmentSeries.getLower()
.- Specified by:
getLowerNonZeroHost
in interfaceIPAddressSegmentSeries
- Specified by:
getLowerNonZeroHost
in classIPAddressSection
- Returns:
- the lowest IP address series whose host is non-zero, or null if no such address section exists.
-
getLower
Description copied from interface:AddressSegmentSeries
If this represents a series with ranging values, returns a series representing the lower values of the range. If this represents an series with a single value in each segment, returns this.- Specified by:
getLower
in interfaceAddressComponentRange
- Specified by:
getLower
in interfaceAddressSection
- Specified by:
getLower
in interfaceAddressSegmentSeries
- Specified by:
getLower
in interfaceIPAddressSegmentSeries
- Specified by:
getLower
in classIPAddressSection
- Returns:
-
getUpper
Description copied from interface:AddressSegmentSeries
If this represents a series with ranging values, returns a series representing the upper values of the range If this represents a series with a single value in each segment, returns this.- Specified by:
getUpper
in interfaceAddressComponentRange
- Specified by:
getUpper
in interfaceAddressSection
- Specified by:
getUpper
in interfaceAddressSegmentSeries
- Specified by:
getUpper
in interfaceIPAddressSegmentSeries
- Specified by:
getUpper
in classIPAddressSection
- Returns:
-
reverseBits
Description copied from interface:IPAddressSegmentSeries
Returns a new series which has the bits reversed.If this has an associated prefix length, then the prefix length is dropped in the reversed series.
If this represents a range of values that cannot be reversed, because reversing the range results in a set of addresses that cannot be described by a range, then this throws
IncompatibleAddressException
. In such cases you can callIPAddressSegmentSeries.iterator()
,IPAddressSegmentSeries.getLower()
,IPAddressSegmentSeries.getUpper()
or some other method to transform the address into an address representing a single value before reversing.- Specified by:
reverseBits
in interfaceAddressComponent
- Specified by:
reverseBits
in interfaceAddressSection
- Specified by:
reverseBits
in interfaceAddressSegmentSeries
- Specified by:
reverseBits
in interfaceIPAddressSegmentSeries
- Specified by:
reverseBits
in classIPAddressSection
- Parameters:
perByte
- if true, only the bits in each byte are reversed, if false, then all bits in the address are reversed- Returns:
-
reverseBytes
Description copied from interface:AddressSegmentSeries
Returns a new segment series with the bytes reversed.- Specified by:
reverseBytes
in interfaceAddressComponent
- Specified by:
reverseBytes
in interfaceAddressSection
- Specified by:
reverseBytes
in interfaceAddressSegmentSeries
- Specified by:
reverseBytes
in interfaceIPAddressSegmentSeries
- Specified by:
reverseBytes
in classIPAddressSection
- Returns:
-
reverseBytesPerSegment
Description copied from interface:AddressSegmentSeries
Returns a new segment series with the bytes reversed within each segment.- Specified by:
reverseBytesPerSegment
in interfaceAddressSection
- Specified by:
reverseBytesPerSegment
in interfaceAddressSegmentSeries
- Specified by:
reverseBytesPerSegment
in interfaceIPAddressSegmentSeries
- Specified by:
reverseBytesPerSegment
in classIPAddressSection
- Returns:
-
reverseSegments
Description copied from interface:AddressSegmentSeries
Returns a new segment series with the segments reversed. This does not throwIncompatibleAddressException
since all address series can reverse their segments.- Specified by:
reverseSegments
in interfaceAddressSection
- Specified by:
reverseSegments
in interfaceAddressSegmentSeries
- Specified by:
reverseSegments
in interfaceIPAddressSegmentSeries
- Specified by:
reverseSegments
in classIPAddressSection
- Returns:
-
getIterable
Description copied from interface:AddressComponentRange
Useful for using an instance in a "for-each loop". Otherwise just callAddressComponentRange.iterator()
directly.- Specified by:
getIterable
in interfaceAddressComponentRange
- Specified by:
getIterable
in interfaceAddressSection
- Specified by:
getIterable
in interfaceAddressSegmentSeries
- Specified by:
getIterable
in interfaceIPAddressSegmentSeries
- Specified by:
getIterable
in classIPAddressSection
- Returns:
-
nonZeroHostIterator
Description copied from interface:IPAddressSegmentSeries
Similar to the iterator, but series with a host of zero are skipped.- Specified by:
nonZeroHostIterator
in interfaceIPAddressSegmentSeries
- Specified by:
nonZeroHostIterator
in classIPAddressSection
- Returns:
-
iterator
Description copied from interface:AddressComponentRange
Iterates through the individual address components.An address component can represent an individual segment, address, or section, or it can represent multiple, typically a subnet of addresses or a range of segment or section values.
Call
AddressItem.isMultiple()
to determine if this instance represents multiple, orAddressItem.getCount()
for the count.- Specified by:
iterator
in interfaceAddressComponentRange
- Specified by:
iterator
in interfaceAddressSection
- Specified by:
iterator
in interfaceAddressSegmentSeries
- Specified by:
iterator
in interfaceIPAddressSegmentSeries
- Specified by:
iterator
in interfaceIterable<IPv6AddressSection>
- Specified by:
iterator
in classIPAddressSection
- Returns:
-
spliterator
Description copied from interface:AddressComponentRange
Partitions and traverses through the individual address components.- Specified by:
spliterator
in interfaceAddressComponent
- Specified by:
spliterator
in interfaceAddressComponentRange
- Specified by:
spliterator
in interfaceAddressSection
- Specified by:
spliterator
in interfaceAddressSegmentSeries
- Specified by:
spliterator
in interfaceIPAddressSegmentSeries
- Specified by:
spliterator
in interfaceIterable<IPv6AddressSection>
- Specified by:
spliterator
in classIPAddressSection
- Returns:
-
stream
Description copied from interface:AddressComponentRange
Returns a sequential stream of the individual address components. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Specified by:
stream
in interfaceAddressComponentRange
- Specified by:
stream
in interfaceAddressSection
- Specified by:
stream
in interfaceAddressSegmentSeries
- Specified by:
stream
in interfaceIPAddressSegmentSeries
- Specified by:
stream
in classIPAddressSection
- Returns:
-
prefixIterator
Description copied from interface:AddressSegmentSeries
Iterates through the individual prefixes.If the series has no prefix length, then this is equivalent to
AddressSegmentSeries.iterator()
- Specified by:
prefixIterator
in interfaceAddressSection
- Specified by:
prefixIterator
in interfaceAddressSegmentSeries
- Specified by:
prefixIterator
in interfaceIPAddressSegmentSeries
- Specified by:
prefixIterator
in classIPAddressSection
-
prefixSpliterator
Description copied from interface:AddressSegmentSeries
Partitions and traverses through the individual prefixes for the prefix length of this series.- Specified by:
prefixSpliterator
in interfaceAddressSection
- Specified by:
prefixSpliterator
in interfaceAddressSegmentSeries
- Specified by:
prefixSpliterator
in interfaceIPAddressSegmentSeries
- Specified by:
prefixSpliterator
in classIPAddressSection
- Returns:
-
prefixStream
Description copied from interface:AddressSegmentSeries
Returns a sequential stream of the individual prefixes for the prefix length of this series. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Specified by:
prefixStream
in interfaceAddressSection
- Specified by:
prefixStream
in interfaceAddressSegmentSeries
- Specified by:
prefixStream
in interfaceIPAddressSegmentSeries
- Specified by:
prefixStream
in classIPAddressSection
- Returns:
-
prefixBlockIterator
Description copied from interface:AddressSegmentSeries
Iterates through the individual prefix blocks.If the series has no prefix length, then this is equivalent to
AddressSegmentSeries.iterator()
- Specified by:
prefixBlockIterator
in interfaceAddressSection
- Specified by:
prefixBlockIterator
in interfaceAddressSegmentSeries
- Specified by:
prefixBlockIterator
in interfaceIPAddressSegmentSeries
- Specified by:
prefixBlockIterator
in classIPAddressSection
-
prefixBlockSpliterator
Description copied from interface:AddressSegmentSeries
Partitions and traverses through the individual prefix blocks for the prefix length of this series.- Specified by:
prefixBlockSpliterator
in interfaceAddressSection
- Specified by:
prefixBlockSpliterator
in interfaceAddressSegmentSeries
- Specified by:
prefixBlockSpliterator
in interfaceIPAddressSegmentSeries
- Specified by:
prefixBlockSpliterator
in classIPAddressSection
- Returns:
-
prefixBlockStream
Description copied from interface:AddressSegmentSeries
Returns a sequential stream of the individual prefix blocks for the prefix length of this series. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Specified by:
prefixBlockStream
in interfaceAddressSection
- Specified by:
prefixBlockStream
in interfaceAddressSegmentSeries
- Specified by:
prefixBlockStream
in interfaceIPAddressSegmentSeries
- Specified by:
prefixBlockStream
in classIPAddressSection
- Returns:
-
blockIterator
Description copied from interface:IPAddressSegmentSeries
Iterates through series that can be obtained by iterating through all the upper segments up to the given segment count. Segments following remain the same in all iterated series.For instance, given the IPv4 subnet 1-2.3-4.5-6.7, given the count argument 2, it will iterate through 1.3.5-6.7, 1.4.5-6.7, 2.3.5-6.7, 2.4.5-6.7
- Specified by:
blockIterator
in interfaceIPAddressSegmentSeries
- Specified by:
blockIterator
in classIPAddressSection
- Parameters:
segmentCount
-- Returns:
-
blockSpliterator
Description copied from interface:IPAddressSegmentSeries
Partitions and traverses through the individual sequential blocks created from each of the individual values up to the given segment count.- Specified by:
blockSpliterator
in interfaceIPAddressSegmentSeries
- Specified by:
blockSpliterator
in classIPAddressSection
- Returns:
-
blockStream
Description copied from interface:IPAddressSegmentSeries
Returns a sequential stream of the individual blocks created from each of the individual values up to the given segment count. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Specified by:
blockStream
in interfaceIPAddressSegmentSeries
- Specified by:
blockStream
in classIPAddressSection
- Returns:
-
sequentialBlockIterator
Description copied from interface:IPAddressSegmentSeries
Iterates through the sequential series that make up this series. Generally this means finding the count of segments for which the segments that follow are not full range, and then usingIPAddressSegmentSeries.blockIterator(int)
with that segment count.For instance, given the IPv4 subnet 1-2.3-4.5-6.7-8, it will iterate through 1.3.5.7-8, 1.3.6.7-8, 1.4.5.7-8, 1.4.6.7-8, 2.3.5.7-8, 2.3.6.7-8, 2.4.6.7-8, 2.4.6.7-8.
Use
IPAddressSegmentSeries.getSequentialBlockCount()
to get the count of iterated elements.- Specified by:
sequentialBlockIterator
in interfaceIPAddressSegmentSeries
- Overrides:
sequentialBlockIterator
in classIPAddressSection
- Returns:
-
sequentialBlockSpliterator
Description copied from interface:IPAddressSegmentSeries
Partitions and traverses through the individual sequential blocks.- Specified by:
sequentialBlockSpliterator
in interfaceIPAddressSegmentSeries
- Overrides:
sequentialBlockSpliterator
in classIPAddressSection
- Returns:
-
sequentialBlockStream
Description copied from interface:IPAddressSegmentSeries
Returns a sequential stream of the individual sequential blocks. For a parallel stream, callBaseStream.parallel()
on the returned stream.Use
IPAddressSegmentSeries.getSequentialBlockCount()
to get the count of streamed elements.- Specified by:
sequentialBlockStream
in interfaceIPAddressSegmentSeries
- Overrides:
sequentialBlockStream
in classIPAddressSection
- Returns:
-
segmentsNonZeroHostIterator
Description copied from interface:IPAddressSegmentSeries
Similar to the segments iterator, but series with a host of zero are skipped.- Specified by:
segmentsNonZeroHostIterator
in interfaceIPAddressSegmentSeries
- Returns:
-
segmentsIterator
Description copied from interface:AddressSegmentSeries
Iterates through the individual segments.- Specified by:
segmentsIterator
in interfaceAddressSegmentSeries
- Specified by:
segmentsIterator
in interfaceIPAddressSegmentSeries
-
segmentsSpliterator
public AddressComponentRangeSpliterator<IPv6AddressSection,IPv6AddressSegment[]> segmentsSpliterator()Description copied from interface:AddressSegmentSeries
Partitions and traverses through the individual segment arrays.- Specified by:
segmentsSpliterator
in interfaceAddressSegmentSeries
- Specified by:
segmentsSpliterator
in interfaceIPAddressSegmentSeries
- Returns:
-
segmentsStream
Description copied from interface:AddressSegmentSeries
Returns a sequential stream of the individual segment arrays. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Specified by:
segmentsStream
in interfaceAddressSegmentSeries
- Specified by:
segmentsStream
in interfaceIPAddressSegmentSeries
- Returns:
-
getMaxValue
-
incrementBoundary
Description copied from interface:AddressSegmentSeries
If the given increment is positive, adds the value to the upper series (AddressSegmentSeries.getUpper()
) in the subnet range to produce a new series. If the given increment is negative, adds the value to the lower series (AddressSegmentSeries.getLower()
) in the subnet range to produce a new series. If the increment is zero, returns this.In the case where the series is a single value, this simply returns the address produced by adding the given increment to this address series.
- Specified by:
incrementBoundary
in interfaceAddressSection
- Specified by:
incrementBoundary
in interfaceAddressSegmentSeries
- Specified by:
incrementBoundary
in interfaceIPAddressSegmentSeries
- Specified by:
incrementBoundary
in classIPAddressSection
- Parameters:
increment
-- Returns:
-
increment
Description copied from interface:AddressSegmentSeries
Returns the series from the subnet that is the given increment upwards into the subnet range, with the increment of 0 returning the first address in the range.If the subnet has multiple values and the increment exceeds the subnet size, then the amount by which it exceeds the size - 1 is added to the upper series of the range (the final iterator value).
If the increment is negative, it is added to the lower series of the range (the first iterator value).
If the subnet is just a single address values, the series is simply incremented by the given value, positive or negative.
If a subnet has multiple values, a positive increment value is equivalent to the same number of values from the
AddressSegmentSeries.iterator()
For instance, a increment of 0 is the first value from the iterator, an increment of 1 is the second value from the iterator, and so on. A negative increment added to the subnet count is equivalent to the same number of values preceding the upper bound of the iterator. For instance, an increment of count - 1 is the last value from the iterator, an increment of count - 2 is the second last value, and so on.An increment of size count gives you the series just above the highest series of the subnet. To get the series just below the lowest series of the subnet, use the increment -1.
- Specified by:
increment
in interfaceAddressSection
- Specified by:
increment
in interfaceAddressSegmentSeries
- Specified by:
increment
in interfaceIPAddressSegmentSeries
- Specified by:
increment
in classIPAddressSection
- Parameters:
increment
-- Returns:
-
getPrefixCount
Description copied from interface:AddressItem
The count of the number of distinct values within the prefix part of the address item, the bits that appear within the prefix length.- Specified by:
getPrefixCount
in interfaceAddressDivisionSeries
- Specified by:
getPrefixCount
in interfaceAddressItem
- Parameters:
prefixLength
-- Returns:
-
getDivision
- Specified by:
getDivision
in interfaceAddressDivisionSeries
- Specified by:
getDivision
in interfaceAddressStringDivisionSeries
- Specified by:
getDivision
in interfaceIPAddressDivisionSeries
- Specified by:
getDivision
in interfaceIPAddressStringDivisionSeries
- Overrides:
getDivision
in classIPAddressSection
- Returns:
- the given division in this series. The first is at index 0.
-
getSegment
Description copied from interface:AddressSegmentSeries
Returns the segment from this series at the given index. The first segment is at index 0. A segment is an address division, seeAddressDivisionSeries.getDivision(int)
, the difference being that all segments in a given series are the same bit count, while divisions can have variable length.- Specified by:
getSegment
in interfaceAddressSegmentSeries
- Specified by:
getSegment
in interfaceIPAddressSegmentSeries
- Overrides:
getSegment
in classIPAddressSection
- Returns:
-
getSegments
-
getSegments
-
isEUI64
public boolean isEUI64()Equivalent to isEUI64(false)- Returns:
-
isEUI64
public boolean isEUI64(boolean partial) Whether this section is consistent with an EUI64 section, which means it came from an extended 8 byte address, and the corresponding segments in the middle match 0xff and 0xfe- Parameters:
partial
- whether missing segments are considered a match- Returns:
-
toEUI
Returns the corresponding mac section, or null if this address section does not correspond to a mac section. If this address section has a prefix length it is ignored.- Parameters:
extended
-- Returns:
-
getEmbeddedIPv4AddressSection
Produces an IPv4 address section from any sequence of bytes in this IPv6 address section- Parameters:
startIndex
- the byte index in this section to start fromendIndex
- the byte index in this section to end at- Returns:
- Throws:
IndexOutOfBoundsException
- See Also:
-
getEmbeddedIPv4AddressSection
Gets the IPv4 section corresponding to the lowest (least-significant) 4 bytes in the original address, which will correspond to between 0 and 4 bytes in this address. Many IPv4 to IPv6 mapping schemes (but not all) use these 4 bytes for a mapped IPv4 address.- Returns:
- the embedded IPv4 section or null
- See Also:
-
createNonMixedSection
-
getMixedAddressSection
-
createSection
public static IPv6AddressSection createSection(IPv6AddressNetwork.IPv6AddressCreator creator, IPv6AddressSegment[] nonMixedSection, IPv4Address mixedSection) throws IncompatibleAddressException - Throws:
IncompatibleAddressException
-
getIPv6Address
Create an IPv6 mixed address using the given address for the embedded IPv4 segments- Parameters:
mixedSection
- the IPv4 address used to construct the terminating segments of the returned address- Returns:
-
getBitsPerSegment
public int getBitsPerSegment()Description copied from interface:AddressSegmentSeries
Returns the number of bits comprising each segment in this series. Segments in the same series are equal length.- Specified by:
getBitsPerSegment
in interfaceAddressSegmentSeries
- Returns:
-
getBytesPerSegment
public int getBytesPerSegment()Description copied from interface:AddressSegmentSeries
Returns the number of bytes comprising each segment in this series. Segments in the same series are equal length.- Specified by:
getBytesPerSegment
in interfaceAddressSegmentSeries
- Returns:
-
getBitCount
public int getBitCount()Description copied from interface:AddressItem
Provides the number of bits comprising this address item- Specified by:
getBitCount
in interfaceAddressDivisionSeries
- Specified by:
getBitCount
in interfaceAddressItem
- Overrides:
getBitCount
in classIPAddressSection
- Returns:
- the number of bits
-
getByteCount
public int getByteCount()Description copied from interface:AddressItem
Provides the number of bytes required for this address item, rounding up if the bit count is not a multiple of 8- Specified by:
getByteCount
in interfaceAddressItem
- Overrides:
getByteCount
in classIPAddressSection
- Returns:
- the number of bytes
-
hasUppercaseVariations
public boolean hasUppercaseVariations(int base, boolean lowerOnly) Returns whether this subnet or address has alphabetic digits when printed. Note that this method does not indicate whether any address contained within this subnet has alphabetic digits, only whether the subnet itself when printed has alphabetic digits.- Returns:
- whether the section has alphabetic digits when printed.
-
isIPv6
public boolean isIPv6()- Overrides:
isIPv6
in classIPAddressSection
-
getIPVersion
Description copied from interface:IPAddressSegmentSeries
Returns the version of this segment series- Specified by:
getIPVersion
in interfaceIPAddressSegmentSeries
- Returns:
-
append
-
appendToNetwork
-
insert
-
replace
Replace the segments of this section starting at the given index with the given replacement segments- Parameters:
index
-replacement
-- Returns:
-
replace
public IPv6AddressSection replace(int startIndex, int endIndex, IPv6AddressSection replacement, int replacementStartIndex, int replacementEndIndex) Replaces segments starting from startIndex and ending before endIndex with the segments starting at replacementStartIndex and ending before replacementEndIndex from the replacement section- Parameters:
startIndex
-endIndex
-replacement
-replacementStartIndex
-replacementEndIndex
-- Returns:
- Throws:
IndexOutOfBoundsException
AddressValueException
- if the resulting section would exceed the maximum segment count for this address type and version
-
replace
public IPv6AddressSection replace(int startIndex, int endIndex, IPv6AddressSection replacement, int replacementStartIndex, int replacementEndIndex, boolean appendNetwork) -
contains
Description copied from interface:AddressSection
Determines if one section contains another.Sections must have the same number of segments to be comparable.
For sections which are aware of their position in an address (IPv6 and MAC), their respective positions must match to be comparable.
- Specified by:
contains
in interfaceAddressSection
- Overrides:
contains
in classIPAddressSection
- Parameters:
other
-- Returns:
- whether this subnet contains the given address section
-
prefixEquals
Description copied from interface:AddressSection
Determines if the argument section matches this section up to the prefix length of this section.The entire prefix of this section must be present in the other section to be comparable.
For sections which are aware of their position in an address (IPv6 and MAC), the argument section must have the same or an earlier position in the address to match all prefix segments of this section, and the matching is lined up relative to the position.
- Specified by:
prefixEquals
in interfaceAddressSection
- Parameters:
o
-- Returns:
- whether the argument section has the same address section prefix as this
-
prefixContains
Description copied from class:IPAddressSection
Returns whether the prefix of this address contains all values of the same bits in the given address or subnet- Specified by:
prefixContains
in classIPAddressSection
- Parameters:
o
-- Returns:
-
matchesWithMask
Description copied from class:IPAddressSection
Applies the mask to this address section and then compares values with the given address section- Overrides:
matchesWithMask
in classIPAddressSection
- Parameters:
other
-mask
-- Returns:
-
equals
Description copied from class:AddressDivisionGroupingBase
Two groupings are equal if: - they match type/version (ipv4, ipv6, mac, or a specific grouping class) - they match division counts - each division matches bit counts - each division matches their specific grouping class - each division matches values Prefix lengths, for those groupings and/or divisionsS that have them, are ignored.- Overrides:
equals
in classIPAddressDivisionGrouping
-
intersect
Produces the subnet sections whose addresses are found in both this and the given argument.This is also known as the conjunction of the two sets of address sections.
- Parameters:
other
-- Returns:
- the section containing the sections found in both this and the given subnet sections
- Throws:
SizeMismatchException
-
subtract
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).Computes the subnet difference, the set of addresses in this address section but not in the provided section. This is also known as the relative complement of the given argument in this subnet.
Keep in mind this is set subtraction, not subtraction of segment values. We have a subnet of addresses and we are removing some of those addresses.
- Parameters:
other
-- Returns:
- the difference
- Throws:
SizeMismatchException
- if the two sections have different sizes
-
getNetwork
Description copied from interface:AddressComponent
Returns the network object for components of the same version (eg IPv4, IPv6 and MAC each have their own network object)- Specified by:
getNetwork
in interfaceAddressComponent
- Specified by:
getNetwork
in interfaceIPAddressSegmentSeries
- Specified by:
getNetwork
in interfaceIPAddressStringDivisionSeries
- Overrides:
getNetwork
in classIPAddressDivisionGrouping
- Returns:
-
getIPv4Network
-
getMACNetwork
-
adjustPrefixBySegment
Description copied from interface:AddressSegmentSeries
Increases or decreases prefix length to the next segment boundary.Follows the same rules as
AddressSegmentSeries.adjustPrefixLength(int)
:
When prefix length is increased, the bits moved within the prefix become zero. When a prefix length is decreased, the bits moved outside the prefix become zero. To avoid the zeroing behaviour, useAddressSegmentSeries.adjustPrefixBySegment(boolean, boolean)
with second arg false.- Specified by:
adjustPrefixBySegment
in interfaceAddressSection
- Specified by:
adjustPrefixBySegment
in interfaceAddressSegmentSeries
- Specified by:
adjustPrefixBySegment
in interfaceIPAddressSegmentSeries
- Specified by:
adjustPrefixBySegment
in classIPAddressSection
- Parameters:
nextSegment
- whether to move prefix to previous or following segment boundary- Returns:
-
adjustPrefixBySegment
Description copied from interface:AddressSegmentSeries
Increases or decreases prefix length to the next segment boundary.- Specified by:
adjustPrefixBySegment
in interfaceAddressSection
- Specified by:
adjustPrefixBySegment
in interfaceAddressSegmentSeries
- Specified by:
adjustPrefixBySegment
in interfaceIPAddressSegmentSeries
- Overrides:
adjustPrefixBySegment
in classIPAddressSection
- Parameters:
nextSegment
- whether to move prefix to previous or following segment boundaryzeroed
- whether the bits that move from one side of the prefix to the other become zero or retain their original values- Returns:
-
adjustPrefixLength
Description copied from interface:AddressSegmentSeries
Increases or decreases prefix length by the given increment.When prefix length is increased, the bits moved within the prefix become zero. When the prefix is extended beyond the segment series boundary, it is removed. When a prefix length is decreased, the bits moved outside the prefix become zero. To avoid the zeroing behaviour, use
AddressSegmentSeries.adjustPrefixLength(int, boolean)
with second arg false.- Specified by:
adjustPrefixLength
in interfaceAddressSection
- Specified by:
adjustPrefixLength
in interfaceAddressSegmentSeries
- Specified by:
adjustPrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
adjustPrefixLength
in classIPAddressSection
- Parameters:
adjustment
-- Returns:
-
adjustPrefixLength
Description copied from interface:AddressSegmentSeries
Increases or decreases prefix length by the given increment.- Specified by:
adjustPrefixLength
in interfaceAddressSection
- Specified by:
adjustPrefixLength
in interfaceAddressSegmentSeries
- Specified by:
adjustPrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
adjustPrefixLength
in classIPAddressSection
- Parameters:
adjustment
- the incrementzeroed
- whether the bits that move from one side of the prefix to the other become zero or retain their original values- Returns:
-
applyPrefixLength
@Deprecated public IPv6AddressSection applyPrefixLength(int networkPrefixLength) throws PrefixLenException Deprecated.Description copied from interface:AddressSegmentSeries
Applies the given prefix length to create a new segment series.Similar to
AddressSegmentSeries.setPrefixLength(int)
except that prefix lengths are never increased. When this series already has a prefix length that is less than or equal to the requested prefix length, this series is returned.Otherwise the returned series has the given prefix length.
The bits moved outside the prefix will become zero in the returned series.
- Specified by:
applyPrefixLength
in interfaceAddressSection
- Specified by:
applyPrefixLength
in interfaceAddressSegmentSeries
- Specified by:
applyPrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
applyPrefixLength
in classIPAddressSection
- Parameters:
networkPrefixLength
-- Returns:
- Throws:
PrefixLenException
- See Also:
-
setPrefixLength
Description copied from interface:AddressSegmentSeries
Sets the prefix length.If this series has a prefix length, and the prefix length is increased, the bits moved within the prefix become zero. For an alternative that does not set bits to zero, use
AddressSegmentSeries.setPrefixLength(int, boolean)
with the second argument as false.When the prefix is extended beyond the segment series boundary, it is removed.
The bits that move from one side of the prefix length to the other (ie bits moved into the prefix or outside the prefix) are zeroed.
- Specified by:
setPrefixLength
in interfaceAddressSection
- Specified by:
setPrefixLength
in interfaceAddressSegmentSeries
- Specified by:
setPrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
setPrefixLength
in classIPAddressSection
- Parameters:
networkPrefixLength
-- Returns:
- Throws:
PrefixLenException
-
setPrefixLength
public IPv6AddressSection setPrefixLength(int networkPrefixLength, boolean withZeros) throws PrefixLenException Description copied from interface:AddressSegmentSeries
Sets the prefix length.When the prefix is extended beyond the segment series boundary, it is removed.
- Specified by:
setPrefixLength
in interfaceAddressSection
- Specified by:
setPrefixLength
in interfaceAddressSegmentSeries
- Specified by:
setPrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
setPrefixLength
in classIPAddressSection
- Parameters:
withZeros
- whether the bits that move from one side of the prefix length to the other (ie bits moved into the prefix or outside the prefix) are zeroed.- Returns:
- Throws:
PrefixLenException
-
setPrefixLength
public IPv6AddressSection setPrefixLength(int networkPrefixLength, boolean withZeros, boolean zeroHostIsBlock) throws PrefixLenException Description copied from class:IPAddressSection
Sets the prefix length while allowing the caller to control whether bits moved in or out of the prefix become zero, and whether a zero host for the new prefix bits can be translated into a prefix block. The latter behaviour only applies to the default prefix handling configuration, PREFIXED_ZERO_HOSTS_ARE_SUBNETS. The methodsIPAddressSection.setPrefixLength(int, boolean)
andIPAddressSection.setPrefixLength(int)
use a value of true for zeroed and for zeroHostIsBlock.For example, when zeroHostIsBlock is true, applying to 1.2.0.0 the prefix length 16 results in 1.2.*.*/16
Or if you start with 1.2.0.0/24, setting the prefix length to 16 results in a zero host followed by the existing prefix block, which is then converted to a full prefix block, 1.2.*.*/16
When both zeroed and zeroHostIsBlock are true, applying the prefix length of 16 to 1.2.4.0/24 also results in a zero host followed by the existing prefix block, which is then converted to a full prefix block, 1.2.*.*/16.
When both zeroed and zeroHostIsBlock are false, the resulting address always encompasses the same set of addresses as the original, albeit with a different prefix length.
- Specified by:
setPrefixLength
in classIPAddressSection
- Parameters:
networkPrefixLength
-withZeros
-zeroHostIsBlock
-- Returns:
- Throws:
PrefixLenException
-
removePrefixLength
Deprecated.Description copied from interface:AddressSegmentSeries
Removes the prefix length while zeroing out the bits beyond the prefix.If the series already has a prefix length, the bits outside the prefix become zero. Use
AddressSegmentSeries.withoutPrefixLength()
to remove the prefix length without changing the series values.Equivalent to calling removePrefixLength(true)
- Specified by:
removePrefixLength
in interfaceAddressSection
- Specified by:
removePrefixLength
in interfaceAddressSegmentSeries
- Specified by:
removePrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
removePrefixLength
in classIPAddressSection
- Returns:
- See Also:
-
withoutPrefixLength
Description copied from interface:AddressSegmentSeries
Provides the same address with no prefix. The values remain unchanged.Use
AddressSegmentSeries.removePrefixLength()
as an alternative that deletes the host at the same time by zeroing the host values.- Specified by:
withoutPrefixLength
in interfaceAddressSection
- Specified by:
withoutPrefixLength
in interfaceAddressSegmentSeries
- Specified by:
withoutPrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
withoutPrefixLength
in classIPAddressSection
-
removePrefixLength
Deprecated.Description copied from interface:AddressSegmentSeries
Removes the prefix length. If zeroed is false, the bits that were host bits do not become zero, unlikeAddressSegmentSeries.removePrefixLength()
- Specified by:
removePrefixLength
in interfaceAddressSection
- Specified by:
removePrefixLength
in interfaceAddressSegmentSeries
- Specified by:
removePrefixLength
in interfaceIPAddressSegmentSeries
- Specified by:
removePrefixLength
in classIPAddressSection
- Parameters:
zeroed
- whether the bits outside the prefix become zero- Returns:
-
bitwiseOrNetwork
public IPv6AddressSection bitwiseOrNetwork(IPv6AddressSection mask, int networkPrefixLength) throws IncompatibleAddressException, PrefixLenException, SizeMismatchException Does the bitwise disjunction with this address. Useful when subnetting. Similar tomaskNetwork(IPv6AddressSection, int)
which does the bitwise conjunction.Any existing prefix length is dropped for the new prefix length and the mask is applied up to the end the new prefix length.
- Parameters:
mask
-- Returns:
- Throws:
IncompatibleAddressException
PrefixLenException
SizeMismatchException
-
bitwiseOr
Equivalent tobitwiseOr(IPv6AddressSection, boolean)
with the second argument as false.- Throws:
IncompatibleAddressException
-
bitwiseOr
public IPv6AddressSection bitwiseOr(IPv6AddressSection mask, boolean retainPrefix) throws IncompatibleAddressException, SizeMismatchException Does the bitwise disjunction with this address. Useful when subnetting. Similar tomask(IPv6AddressSection)
which does the bitwise conjunction.- Parameters:
mask
-retainPrefix
- whether to drop the prefix- Returns:
- Throws:
IncompatibleAddressException
SizeMismatchException
-
toZeroHost
Description copied from interface:IPAddressSegmentSeries
Returns the segment series with a host of zero, the host being the bits following the prefix length. If the series has no prefix length, then it returns an all-zero series.The default behaviour is that the resultant series will have the same prefix length. The resultant series will not have a prefix length if
AddressNetwork.getPrefixConfiguration()
isAddressNetwork.PrefixConfiguration.ALL_PREFIXED_ADDRESSES_ARE_SUBNETS
.For instance, you can get the network address for a subnet as follows:
String addrStr = "1.2.3.4/16"; IPAddress address = new IPAddressString(addrStr).getAddress(); IPAddress networkAddress = address.toZeroHost(); //1.2.0.0
- Specified by:
toZeroHost
in interfaceIPAddressSegmentSeries
- Specified by:
toZeroHost
in classIPAddressSection
- Returns:
- Throws:
IncompatibleAddressException
- See Also:
-
toZeroHost
Description copied from interface:IPAddressSegmentSeries
Produces the series with host values of 0 for the given prefix length.If this series has the same prefix length, then the resulting series will too, otherwise the resulting series will have no prefix length.
This is nearly equivalent to doing the mask (bitwise conjunction) of this address series with the network mask for the given prefix length, but without the possibility of IncompatibleAddressException that can occur when applying a mask to a range of values. Instead, in this case, if the resulting series has a range of values, then the resulting series range boundaries will have host values of 0, but not necessarily the intervening values.
For instance, you can get the network address for a subnet of prefix length 16 as follows:
String addrStr = "1.2.3.4"; IPAddress address = new IPAddressString(addrStr).getAddress(); IPAddress networkAddress = address.toZeroHost(16); //1.2.0.0
- Specified by:
toZeroHost
in interfaceIPAddressSegmentSeries
- Specified by:
toZeroHost
in classIPAddressSection
- Parameters:
prefixLength
-- Returns:
-
toZeroNetwork
Description copied from interface:IPAddressSegmentSeries
Returns the segment series with a network of zero, the network being the bits within the prefix length. If the series has no prefix length, then it returns an all-zero series.The default behaviour is that the resultant series will have the same prefix length. The resultant series will not have a prefix length if
AddressNetwork.getPrefixConfiguration()
isAddressNetwork.PrefixConfiguration.ALL_PREFIXED_ADDRESSES_ARE_SUBNETS
.- Specified by:
toZeroNetwork
in interfaceIPAddressSegmentSeries
- Specified by:
toZeroNetwork
in classIPAddressSection
- Returns:
- See Also:
-
toMaxHost
Description copied from interface:IPAddressSegmentSeries
Returns the segment series with a host of all ones. If the series has no prefix length, then it returns an all-ones series.The resultant series will have the same prefix length if
AddressNetwork.getPrefixConfiguration()
is notAddressNetwork.PrefixConfiguration.ALL_PREFIXED_ADDRESSES_ARE_SUBNETS
, otherwise it will no longer have a prefix length.For instance, you can get the broadcast address for a subnet as follows:
String addrStr = "1.2.3.4/16"; IPAddress address = new IPAddressString(addrStr).getAddress(); IPAddress broadcastAddress = address.toMaxHost(); //1.2.255.255
- Specified by:
toMaxHost
in interfaceIPAddressSegmentSeries
- Specified by:
toMaxHost
in classIPAddressSection
- Returns:
- Throws:
IncompatibleAddressException
-
createMaxHost
-
toMaxHost
Description copied from interface:IPAddressSegmentSeries
Produces the series with host values of all one bits for the given prefix length.If this series has the same prefix length, then the resulting series will too, otherwise the resulting series will have no prefix length.
This is nearly equivalent to doing the bitwise or (bitwise disjunction) of this address series with the network mask for the given prefix length, but without the possibility of IncompatibleAddressException that can occur when applying a mask to a range of values. Instead, in this case, if the resulting series has a range of values, then the resulting series range boundaries will have host values of all ones, but not necessarily the intervening values.
For instance, you can get the broadcast address for a subnet of prefix length 16 as follows:
String addrStr = "1.2.3.4"; IPAddress address = new IPAddressString(addrStr).getAddress(); IPAddress broadcastAddress = address.toMaxHost(16); //1.2.255.255
- Specified by:
toMaxHost
in interfaceIPAddressSegmentSeries
- Specified by:
toMaxHost
in classIPAddressSection
- Parameters:
prefixLength
-- Returns:
-
mask
public IPv6AddressSection mask(IPv6AddressSection mask, boolean retainPrefix) throws IncompatibleAddressException, SizeMismatchException Does the bitwise conjuction with this address. Useful when subnetting.- Parameters:
mask
-retainPrefix
- whether to drop the prefix- Returns:
- Throws:
IncompatibleAddressException
SizeMismatchException
-
mask
Equivalent tomask(IPv6AddressSection, boolean)
with the second argument as false.- Throws:
IncompatibleAddressException
-
maskNetwork
public IPv6AddressSection maskNetwork(IPv6AddressSection mask, int networkPrefixLength) throws IncompatibleAddressException, PrefixLenException, SizeMismatchException Applies the given mask to the network section of the address as indicated by the given prefix length. Useful for subnetting. Once you have zeroed a section of the network you can insert bits usingbitwiseOr(IPv6AddressSection)
orreplace(int, IPv6AddressSection)
- Parameters:
mask
-networkPrefixLength
-- Returns:
- Throws:
IncompatibleAddressException
PrefixLenException
SizeMismatchException
-
getHostMask
Description copied from interface:IPAddressSegmentSeries
Returns the host mask associated with the CIDR network prefix length of this series. If this series has no prefix length, then the whole series is considered a host and the all ones host mask is returned.- Specified by:
getHostMask
in interfaceIPAddressSegmentSeries
- Overrides:
getHostMask
in classIPAddressSection
- Returns:
-
getNetworkMask
Description copied from interface:IPAddressSegmentSeries
Returns the network mask associated with the CIDR network prefix length of this series. If this series has no prefix length, then the whole series is considered network and the all ones network mask is returned.- Specified by:
getNetworkMask
in interfaceIPAddressSegmentSeries
- Overrides:
getNetworkMask
in classIPAddressSection
- Returns:
-
getNetworkSection
Description copied from interface:IPAddressSegmentSeries
Returns the network section of the series if the series has a CIDR network prefix length, otherwise it returns the entire series as a prefixed series with prefix matching the address bit length.- Specified by:
getNetworkSection
in interfaceIPAddressSegmentSeries
- Returns:
-
getNetworkSection
Description copied from interface:IPAddressSegmentSeries
Returns the network section of the series. The returned section will have only as many segments as needed as indicated by networkPrefixLength. It will have networkPrefixLength as its associated prefix length, unless this address already has a smaller prefix length, in which case the existing prefix length is retained.- Specified by:
getNetworkSection
in interfaceIPAddressSegmentSeries
- Parameters:
networkPrefixLength
-- Returns:
- Throws:
PrefixLenException
-
getNetworkSection
public IPv6AddressSection getNetworkSection(int networkPrefixLength, boolean withPrefixLength) throws PrefixLenException Description copied from interface:IPAddressSegmentSeries
Returns the network section of the series. The returned section will have only as many segments as needed as indicated by networkPrefixLength. If withPrefixLength is true, it will have networkPrefixLength as its associated prefix length, unless this series already has a smaller prefix length, in which case the existing prefix length is retained.- Specified by:
getNetworkSection
in interfaceIPAddressSegmentSeries
- Parameters:
networkPrefixLength
-withPrefixLength
- whether the resulting section will have networkPrefixLength as the associated prefix length or not- Returns:
- Throws:
PrefixLenException
-
getHostSection
Description copied from interface:IPAddressSegmentSeries
Returns the host section of the series. The returned section will have only as many segments as needed as determined by the existing CIDR network prefix length. If this series has no CIDR prefix length, the returned host section will be the full section associated with a prefix length of 0.- Specified by:
getHostSection
in interfaceIPAddressSegmentSeries
- Returns:
-
getHostSection
Description copied from interface:IPAddressSegmentSeries
Returns the host section of the address as indicated by the network prefix length provided. The returned section will have only as many segments as needed to hold the host as indicated by the provided network prefix length.- Specified by:
getHostSection
in interfaceIPAddressSegmentSeries
- Parameters:
networkPrefixLength
-- Returns:
- Throws:
PrefixLenException
-
toPrefixBlock
Description copied from interface:IPAddressSegmentSeries
If this series has a prefix length, returns the subnet block for that prefix. If this series has no prefix length, this series is returned.- Specified by:
toPrefixBlock
in interfaceAddressSection
- Specified by:
toPrefixBlock
in interfaceAddressSegmentSeries
- Specified by:
toPrefixBlock
in interfaceIPAddressSegmentSeries
- Specified by:
toPrefixBlock
in classIPAddressSection
- Returns:
- the subnet block for the prefix length
-
assignPrefixForSingleBlock
Description copied from class:IPAddressSection
Returns the equivalent CIDR address section with a prefix length for which the subnet block for that prefix matches the range of values in this section.If no such prefix length exists, returns null.
If this address represents just a single address, "this" is returned.
- Specified by:
assignPrefixForSingleBlock
in interfaceIPAddressSegmentSeries
- Overrides:
assignPrefixForSingleBlock
in classIPAddressSection
- Returns:
- See Also:
-
assignMinPrefixForBlock
Description copied from class:IPAddressSection
Constructs an equivalent address section with the smallest CIDR prefix possible (largest network), such that the range of values are a set of subnet blocks for that prefix.- Specified by:
assignMinPrefixForBlock
in interfaceIPAddressSegmentSeries
- Overrides:
assignMinPrefixForBlock
in classIPAddressSection
- Returns:
- See Also:
-
toPrefixBlock
Description copied from interface:IPAddressSegmentSeries
Returns the segment series of the same length that spans all hosts. The network prefix length will be the one provided, and the network values will match the same of this series.- Specified by:
toPrefixBlock
in interfaceIPAddressSegmentSeries
- Specified by:
toPrefixBlock
in classIPAddressSection
- Parameters:
networkPrefixLength
-- Returns:
- Throws:
PrefixLenException
-
coverWithPrefixBlock
Description copied from interface:IPAddressSegmentSeries
Returns the minimal-size prefix block that covers all the values in this series. The resulting block will have a larger series count than this, unless this series is already a prefix block.- Specified by:
coverWithPrefixBlock
in interfaceIPAddressSegmentSeries
- Specified by:
coverWithPrefixBlock
in classIPAddressSection
-
coverWithPrefixBlock
public IPv6AddressSection coverWithPrefixBlock(IPv6AddressSection other) throws AddressConversionException - Throws:
AddressConversionException
-
spanWithPrefixBlocks
Produces an array of prefix blocks that spans the same set of values.Unlike
spanWithPrefixBlocks(IPv6AddressSection)
this method only includes blocks that are a part of this section.- Specified by:
spanWithPrefixBlocks
in interfaceIPAddressSegmentSeries
-
spanWithPrefixBlocks
public IPv6AddressSection[] spanWithPrefixBlocks(IPv6AddressSection other) throws AddressPositionException Produces the list of prefix block subnets that span from this series to the given series.- Parameters:
other
-- Returns:
- Throws:
AddressPositionException
-
spanWithRangedSegments
Deprecated.- Parameters:
other
-- Returns:
-
spanWithSequentialBlocks
Produces an array of blocks that are sequential that cover the same set of sections as this.This array can be shorter than that produced by
spanWithPrefixBlocks()
and is never longer.Unlike
spanWithSequentialBlocks(IPv6AddressSection)
this method only includes values that are a part of this section.- Specified by:
spanWithSequentialBlocks
in interfaceIPAddressSegmentSeries
- Throws:
AddressConversionException
-
spanWithSequentialBlocks
public IPv6AddressSection[] spanWithSequentialBlocks(IPv6AddressSection other) throws AddressPositionException Produces a list of range subnets that span from this series to the given series.- Parameters:
other
-- Returns:
- Throws:
AddressPositionException
-
mergePrefixBlocks
@Deprecated public IPv6AddressSection[] mergePrefixBlocks(IPv6AddressSection... sections) throws SizeMismatchException Deprecated.- Parameters:
sections
-- Returns:
- Throws:
SizeMismatchException
-
mergeToPrefixBlocks
public IPv6AddressSection[] mergeToPrefixBlocks(IPv6AddressSection... sections) throws SizeMismatchException, AddressPositionException Merges this with the list of sections to produce the smallest array of prefix blocks.The resulting array is sorted from lowest address value to highest, regardless of the size of each prefix block.
In version 5.3.1 and earlier, the result was sorted from single address to smallest blocks to largest blocks. For that ordering, sort with
IPAddressSegmentSeries.getPrefixLenComparator()
:
Arrays.sort(result, IPAddressSegmentSeries.getPrefixLenComparator());
- Parameters:
sections
- the sections to merge with this- Returns:
- Throws:
SizeMismatchException
AddressPositionException
-
mergeToSequentialBlocks
public IPv6AddressSection[] mergeToSequentialBlocks(IPv6AddressSection... sections) throws SizeMismatchException Merges this with the list of sections to produce the smallest array of sequential block subnets, going from smallest to largestThe resulting array is sorted by lower address, regardless of the size of each prefix block.
In version 5.3.1 and earlier, the result was sorted from single address to smallest blocks to largest blocks. For that ordering, sort with
IPAddressSegmentSeries.getPrefixLenComparator()
:
Arrays.sort(result, IPAddressSegmentSeries.getPrefixLenComparator());
- Parameters:
sections
- the sections to merge with this- Returns:
- Throws:
SizeMismatchException
-
toCompressedString
This produces the shortest valid string for the address.- Specified by:
toCompressedString
in interfaceAddressSegmentSeries
- Returns:
-
toCanonicalString
This produces a canonical string. RFC 5952 describes canonical representations. http://en.wikipedia.org/wiki/IPv6_address#Recommended_representation_as_text http://tools.ietf.org/html/rfc5952- Specified by:
toCanonicalString
in interfaceAddressSegmentSeries
- Returns:
-
toMixedString
This produces the mixed IPv6/IPv4 string. It is the shortest such string (ie fully compressed). -
toFullString
This produces a string with no compressed segments and all segments of full length, which is 4 characters for IPv6 segments and 3 characters for IPv4 segments.- Specified by:
toFullString
in interfaceIPAddressSegmentSeries
-
toCompressedWildcardString
Description copied from interface:IPAddressSegmentSeries
This is similar to toNormalizedWildcardString, avoiding the CIDR prefix, but with compression as well.- Specified by:
toCompressedWildcardString
in interfaceIPAddressSegmentSeries
-
toPrefixLengthString
Description copied from interface:IPAddressSegmentSeries
Returns a string with a CIDR prefix length if this section has a network prefix length. For IPv6, the host section will be compressed with ::, for IPv4 the host section will be zeros.- Specified by:
toPrefixLengthString
in interfaceIPAddressSegmentSeries
- Returns:
-
toSubnetString
Description copied from interface:IPAddressSegmentSeries
Produces a consistent subnet string. In the case of IPv4, this means that wildcards are used instead of a network prefix. In the case of IPv6, a prefix will be used and the host section will be compressed with ::.- Specified by:
toSubnetString
in interfaceIPAddressSegmentSeries
-
toCanonicalWildcardString
Description copied from interface:IPAddressSegmentSeries
This produces a string similar to the canonical string and avoids the CIDR prefix. Addresses with a network prefix length will be shown with wildcards and ranges instead of using the CIDR prefix length notation. IPv6 addresses will be compressed according to the canonical representation.- Specified by:
toCanonicalWildcardString
in interfaceIPAddressSegmentSeries
-
toNormalizedWildcardString
Description copied from interface:IPAddressSegmentSeries
This produces a string similar to the normalized string and avoids the CIDR prefix. CIDR addresses will be shown with wildcards and ranges instead of using the CIDR prefix notation.- Specified by:
toNormalizedWildcardString
in interfaceIPAddressSegmentSeries
-
toSQLWildcardString
Description copied from interface:IPAddressSegmentSeries
This is the same as the string from toNormalizedWildcardString except that it usesAddress.SEGMENT_SQL_WILDCARD
instead ofAddress.SEGMENT_WILDCARD
and also usesAddress.SEGMENT_SQL_SINGLE_WILDCARD
- Specified by:
toSQLWildcardString
in interfaceIPAddressSegmentSeries
-
toNormalizedString
The normalized string returned by this method is consistent with java.net.Inet6address. IPs are not compressed nor mixed in this representation.- Specified by:
toNormalizedString
in interfaceAddressComponent
- Returns:
-
toBase85String
The base 85 string is described by RFC 1924- Returns:
- Throws:
IncompatibleAddressException
-
toReverseDNSLookupString
Description copied from interface:IPAddressSegmentSeries
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- Specified by:
toReverseDNSLookupString
in interfaceIPAddressSegmentSeries
- Returns:
-
toSegmentedBinaryString
Description copied from interface:IPAddressSegmentSeries
Writes this IP address segment series as a segments of binary values preceded by the "0b" prefix.- Specified by:
toSegmentedBinaryString
in interfaceIPAddressSegmentSeries
-
toNormalizedString
Description copied from interface:IPAddressSegmentSeries
Creates a customized string from this series.- Specified by:
toNormalizedString
in interfaceIPAddressSegmentSeries
- Overrides:
toNormalizedString
in classIPAddressSection
- Parameters:
options
-- Returns:
-
toNormalizedString
-
toNormalizedString
-
toNormalizedString
public static String toNormalizedString(IPAddressSection.IPStringOptions options, CharSequence zone, IPAddressStringDivisionSeries part) -
toStandardStringCollection
Description copied from class:IPAddressSection
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- Overrides:
toStandardStringCollection
in classIPAddressSection
- Returns:
-
toAllStringCollection
Description copied from class:IPAddressSection
Use this method with care... a single IPv6 address can have thousands of string representations. Examples: "::" has 1297 such variations, but only 9 are considered standard "a:b:c:0:d:e:f:1" has 1920 variations, but only 12 are standard Variations included in this method: -all standard variations -choosing specific segments for full leading zeros (::a:b can be ::000a:b, ::a:000b, or ::000a:000b) -choosing which zero-segments to compress (0:0:a:: can be ::a:0:0:0:0:0 or 0:0:a::) -mixed representation (1:2:3:4:5:6:1.2.3.4) -all combinations of such variations Variations omitted from this method: -mixed case of a-f, which you can easily handle yourself with String.equalsIgnoreCase -adding a variable number of leading zeros (::a can be ::0a, ::00a, ::000a) -choosing any number of zero-segments anywhere to compress (:: can be 0:0:0::0:0)- Overrides:
toAllStringCollection
in classIPAddressSection
- Returns:
-
toDatabaseSearchStringCollection
Description copied from class:IPAddressSection
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- Overrides:
toDatabaseSearchStringCollection
in classIPAddressSection
- Returns:
-
toStringCollection
public IPAddressPartStringCollection toStringCollection(IPAddressSection.IPStringBuilderOptions options) - Specified by:
toStringCollection
in interfaceIPAddressSegmentSeries
-
toStringCollection
public IPAddressPartStringCollection toStringCollection(IPv6AddressSection.IPv6StringBuilderOptions opts) -
getParts
Description copied from class:IPAddressSection
Get all representations of this address including this IPAddressSection. This includes:- alternative segment groupings expressed as
IPAddressDivisionGrouping
- conversions to IPv6, and alternative representations of those IPv6 addresses
- Overrides:
getParts
in classIPAddressSection
- Parameters:
opts
-- Returns:
- alternative segment groupings expressed as
-
getParts
-
getZeroSegments
- Overrides:
getZeroSegments
in classIPAddressDivisionGrouping
- Returns:
- the segments which are zero
-
getZeroRangeSegments
- Overrides:
getZeroRangeSegments
in classIPAddressDivisionGrouping
- Returns:
- the segments which are zero or whose prefix-based range includes 0
-
isZero
public boolean isZero()Description copied from interface:AddressItem
Returns whether this item matches the value of zero- Specified by:
isZero
in interfaceAddressItem
- Overrides:
isZero
in classAddressDivisionGroupingBase
- Returns:
- whether this item matches the value of zero
-
mergeToPrefixBlocks(IPv6AddressSection...)