public class IPv6AddressSection extends IPAddressSection implements java.lang.Iterable<IPv6AddressSection>
| Modifier and Type | Class and Description |
|---|---|
static class |
IPv6AddressSection.CompressOptions |
static class |
IPv6AddressSection.IPv6StringBuilderOptions |
static class |
IPv6AddressSection.IPv6StringOptions
Provides a clear way to create a specific type of string.
|
static class |
IPv6AddressSection.IPv6v4MixedAddressSection |
IPAddressSection.IPStringBuilderOptions, IPAddressSection.IPStringOptions, IPAddressSection.SegFunction<R,S>, IPAddressSection.WildcardOptionsIPAddressDivisionGrouping.Range, IPAddressDivisionGrouping.RangeListAddressDivisionGrouping.StringOptions| Modifier and Type | Field and Description |
|---|---|
static IPv6AddressSection |
LINK_LOCAL_PREFIX |
int |
startIndex |
| Constructor and Description |
|---|
IPv6AddressSection(byte[] bytes,
java.lang.Integer prefix) |
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 address
|
IPv6AddressSection(IPv6AddressSegment[] segments,
java.lang.Integer networkPrefixLength)
Use this constructor for any address section that includes the leading segment of an IPv6 address
|
IPv6AddressSection(IPv6AddressSegment[] segments,
int startIndex,
java.lang.Integer networkPrefixLength) |
IPv6AddressSection(IPv6AddressSegment segment,
int startIndex)
Constructs a single segment section with the segment at the given index in the address.
|
IPv6AddressSection(MACAddress eui)
Constructs the corresponding IPv6 address section from a modified EUI-64 (Extended Unique Identifier) address.
|
IPv6AddressSection(MACAddressSection eui)
Constructs the corresponding IPv6 address section from a modified EUI-64 (Extended Unique Identifier) address section.
|
| Modifier and Type | Method and Description |
|---|---|
IPv6AddressSection |
adjustPrefixBySegment(boolean nextSegment)
Increases or decreases prefix length to the next segment boundary.
|
IPv6AddressSection |
adjustPrefixLength(int adjustment)
Increases or decreases prefix length by the given increment.
|
IPv6AddressSection |
append(IPv6AddressSection other) |
IPv6AddressSection |
applyPrefixLength(int networkPrefixLength)
Applies the given network prefix bit length.
|
IPv6AddressSection |
bitwiseOr(IPv6AddressSection mask)
Does the bitwise disjunction with this address.
|
IPv6AddressSection |
bitwiseOrNetwork(IPv6AddressSection mask,
int networkPrefixLength)
Does the bitwise disjunction with this address.
|
boolean |
contains(AddressSection other)
Determines if one section contains another.
|
IPv6AddressSection |
createNonMixedSection() |
boolean |
equals(java.lang.Object o) |
int |
getBitsPerSegment() |
int |
getByteIndex(int networkPrefixLength) |
int |
getBytesPerSegment() |
IPv4AddressSection |
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.
|
IPv4AddressSection |
getEmbeddedIPv4AddressSection(int startIndex,
int endIndex)
Produces an IPv4 address section from any sequence of bytes in this IPv6 address section
|
IPv6AddressSection |
getHostSection(int networkPrefixLength) |
IPAddress.IPVersion |
getIPVersion() |
java.lang.Iterable<IPv6AddressSection> |
getIterable()
Useful for using an instance in a "for-each loop".
|
IPv6AddressSection |
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.
|
IPv6AddressSection.IPv6v4MixedAddressSection |
getMixedAddressSection() |
IPv6AddressNetwork |
getNetwork() |
IPv6AddressSection |
getNetworkSection(int networkPrefixLength) |
IPv6AddressSection |
getNetworkSection(int networkPrefixLength,
boolean withPrefixLength) |
IPAddressStringDivisionSeries[] |
getParts(IPAddressSection.IPStringBuilderOptions opts)
Get all representations of this address including this IPAddressSection.
|
IPAddressStringDivisionSeries[] |
getParts(IPv6AddressSection.IPv6StringBuilderOptions opts) |
IPv6AddressSection |
getSection(int index)
Gets the subsection from the series starting from the given index
|
IPv6AddressSection |
getSection(int index,
int endIndex)
Gets the subsection from the series starting from the given index and ending just before the give endIndex
|
IPv6AddressSegment |
getSegment(int index) |
int |
getSegmentIndex(int networkPrefixLength) |
IPv6AddressSegment[] |
getSegments() |
void |
getSegments(java.util.Collection<? super IPv6AddressSegment> segs) |
void |
getSegments(int start,
int end,
java.util.Collection<? super IPv6AddressSegment> segs) |
IPv6AddressSection |
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.
|
IPAddressDivisionGrouping.RangeList |
getZeroRangeSegments() |
IPAddressDivisionGrouping.RangeList |
getZeroSegments() |
boolean |
hasUppercaseVariations(int base,
boolean lowerOnly)
Returns whether this subnet or address has alphabetic digits when printed.
|
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 0xfe
|
boolean |
isIPv6() |
boolean |
isZero() |
java.util.Iterator<IPv6AddressSection> |
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.
|
IPv6AddressSection |
mask(IPv6AddressSection mask) |
IPv6AddressSection |
maskNetwork(IPv6AddressSection mask,
int networkPrefixLength)
Applies the given mask to the network section of the address as indicated by the given prefix length.
|
IPv6AddressSection |
prepend(IPv6AddressSection other) |
IPv6AddressSection |
removePrefixLength()
Removes the prefix.
|
IPv6AddressSection |
removePrefixLength(boolean zeroed) |
IPv6AddressSection |
replace(IPv6AddressSection other,
int index) |
IPv6AddressSection |
reverseBits(boolean perByte)
Returns a new segment series with the bits reversed.
|
IPv6AddressSection |
reverseBytes()
Returns a new segment series with the bytes reversed.
|
IPv6AddressSection |
reverseBytesPerSegment()
Returns a new segment series with the bytes reversed within each segment.
|
IPv6AddressSection |
reverseSegments()
Returns a new segment series with the segments reversed.
|
java.util.Iterator<IPv6AddressSegment[]> |
segmentsIterator() |
IPv6AddressSection |
setPrefixLength(int networkPrefixLength)
Sets the prefix length.
|
IPv6AddressSection |
setPrefixLength(int networkPrefixLength,
boolean withZeros) |
IPv6AddressSection[] |
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).
|
IPAddressPartStringCollection |
toAllStringCollection()
Use this method with care...
|
java.lang.String |
toBase85String()
The base 85 string is described by RFC 1924
|
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()
This produces the shortest valid string for the address.
|
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
|
MACAddressSection |
toEUI(boolean extended)
Returns the corresponding mac section, or null if this address section does not correspond to a mac section
|
java.lang.String |
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.
|
java.lang.String |
toMixedString()
This produces the mixed IPv6/IPv4 string.
|
java.lang.String |
toNormalizedString()
The normalized string returned by this method is consistent with java.net.Inet6address.
|
java.lang.String |
toNormalizedString(IPAddressSection.IPStringOptions options) |
static java.lang.String |
toNormalizedString(IPAddressSection.IPStringOptions options,
java.lang.CharSequence zone,
IPAddressStringDivisionSeries part) |
java.lang.String |
toNormalizedString(IPv6AddressSection.IPv6StringOptions options) |
java.lang.String |
toNormalizedString(IPv6AddressSection.IPv6StringOptions options,
java.lang.CharSequence zone) |
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 options) |
IPAddressPartStringCollection |
toStringCollection(IPv6AddressSection.IPv6StringBuilderOptions 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, isIPv4, isMaskCompatibleWithRange, toBinaryString, toHexString, toMinPrefixedEquivalent, toNormalizedString, toOctalString, toPrefixedEquivalent, toStringgetDivision, getNetworkPrefixLength, getPrefixLength, isMore, isMultipleByNetworkPrefix, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefixcompareTo, getBytes, getBytes, getCount, getDivisionCount, getUpperBytes, getUpperBytes, hashCode, isMultiple, isRangeEquivalentgetDivision, getPrefixLength, isMore, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefixgetDivisionCountgetBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isMultiplepublic static final IPv6AddressSection LINK_LOCAL_PREFIX
public final int startIndex
public IPv6AddressSection(IPv6AddressSegment segment)
segment - public IPv6AddressSection(IPv6AddressSegment segment, int startIndex)
segment - public IPv6AddressSection(IPv6AddressSegment[] segments)
public IPv6AddressSection(IPv6AddressSegment[] 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 IPv6AddressSection(IPv6AddressSegment[] segments, int startIndex, java.lang.Integer networkPrefixLength)
startIndex - the index of the first segment where this section would be located in a full address, 0 for network sections or full addressessegments - 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 IPv6AddressSection(byte[] bytes,
java.lang.Integer prefix)
public IPv6AddressSection(MACAddress eui)
eui - AddressTypeException - when the MAC address is an EUI-64 that cannot be converted to an IPv6 address (ff-fe section in middle)public IPv6AddressSection(MACAddressSection eui)
eui - AddressTypeException - when the MAC address section is an EUI-64 that cannot be converted to an IPv6 address (ff-fe section in middle)public IPv6AddressSection getSection(int index)
AddressSegmentSeriesgetSection in interface AddressSectiongetSection in interface AddressSegmentSeriesgetSection in class IPAddressSectionpublic IPv6AddressSection getSection(int index, int endIndex)
AddressSegmentSeriesgetSection in interface AddressSectiongetSection in interface AddressSegmentSeriesgetSection in class IPAddressSectionpublic IPv6AddressSegment[] getSegments()
getSegments in interface AddressSegmentSeriesgetSegments in class IPAddressSectionpublic IPv6AddressSection getLower()
IPAddressSectiongetLower in interface AddressComponentgetLower in interface AddressSectiongetLower in interface AddressSegmentSeriesgetLower in class IPAddressSectionpublic IPv6AddressSection getUpper()
IPAddressSectiongetUpper in interface AddressComponentgetUpper in interface AddressSectiongetUpper in interface AddressSegmentSeriesgetUpper in class IPAddressSectionpublic IPv6AddressSection 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 IPv6AddressSection reverseBytes()
AddressSegmentSeriesreverseBytes in interface AddressComponentreverseBytes in interface AddressSectionreverseBytes in interface AddressSegmentSeriesreverseBytes in class IPAddressSectionpublic IPv6AddressSection reverseBytesPerSegment()
AddressSegmentSeriesreverseBytesPerSegment in interface AddressSectionreverseBytesPerSegment in interface AddressSegmentSeriesreverseBytesPerSegment in class IPAddressSectionpublic IPv6AddressSection reverseSegments()
AddressSegmentSeriesreverseSegments in interface AddressSectionreverseSegments in interface AddressSegmentSeriesreverseSegments in class IPAddressSectionpublic java.lang.Iterable<IPv6AddressSection> getIterable()
AddressComponentAddressComponent.iterator() directly.getIterable in interface AddressComponentgetIterable in interface AddressSectiongetIterable in interface AddressSegmentSeriesgetIterable in class IPAddressSectionpublic java.util.Iterator<IPv6AddressSection> 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<IPv6AddressSection>iterator in class IPAddressSectionpublic java.util.Iterator<IPv6AddressSegment[]> segmentsIterator()
segmentsIterator in interface AddressSegmentSeriessegmentsIterator in class IPAddressSectionpublic IPv6AddressSegment getSegment(int index)
getSegment in interface AddressSegmentSeriesgetSegment in class IPAddressSectionpublic void getSegments(java.util.Collection<? super IPv6AddressSegment> segs)
public void getSegments(int start,
int end,
java.util.Collection<? super IPv6AddressSegment> segs)
public boolean isEUI64()
public boolean isEUI64(boolean partial)
partial - whether missing segments are considered a matchpublic MACAddressSection toEUI(boolean extended)
extended - public IPv4AddressSection getEmbeddedIPv4AddressSection(int startIndex, int endIndex)
startIndex - the byte index in this section to start fromendIndex - the byte index in this section to end atjava.lang.IndexOutOfBoundsExceptiongetEmbeddedIPv4AddressSection(),
getMixedAddressSection()public IPv4AddressSection getEmbeddedIPv4AddressSection()
getEmbeddedIPv4AddressSection(int, int),
getMixedAddressSection()public IPv6AddressSection createNonMixedSection()
public IPv6AddressSection.IPv6v4MixedAddressSection getMixedAddressSection()
public int getBitsPerSegment()
getBitsPerSegment in interface AddressSegmentSeriespublic int getBytesPerSegment()
getBytesPerSegment in interface AddressSegmentSeriespublic boolean hasUppercaseVariations(int base,
boolean lowerOnly)
public boolean isIPv6()
isIPv6 in class IPAddressSectionpublic IPAddress.IPVersion getIPVersion()
getIPVersion in class IPAddressSectionpublic IPv6AddressSection replace(IPv6AddressSection other, int index)
public IPv6AddressSection prepend(IPv6AddressSection other)
public IPv6AddressSection append(IPv6AddressSection other)
public boolean contains(AddressSection other)
AddressSectioncontains in interface AddressSectionpublic boolean equals(java.lang.Object o)
equals in class IPAddressDivisionGroupingpublic IPv6AddressSection[] subtract(IPv6AddressSection 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 IPv6AddressNetwork getNetwork()
getNetwork in class IPAddressSectionpublic IPv6AddressSection adjustPrefixBySegment(boolean nextSegment)
AddressSegmentSeriesadjustPrefixBySegment in interface AddressSectionadjustPrefixBySegment in interface AddressSegmentSeriesadjustPrefixBySegment in class IPAddressSectionpublic IPv6AddressSection adjustPrefixLength(int adjustment)
AddressSegmentSeriesadjustPrefixLength in interface AddressSectionadjustPrefixLength in interface AddressSegmentSeriesadjustPrefixLength in class IPAddressSectionpublic IPv6AddressSection applyPrefixLength(int networkPrefixLength)
IPAddressSectionapplyPrefixLength in interface AddressSectionapplyPrefixLength in interface AddressSegmentSeriesapplyPrefixLength in class IPAddressSectionpublic IPv6AddressSection setPrefixLength(int networkPrefixLength)
AddressSegmentSeriessetPrefixLength in interface AddressSectionsetPrefixLength in interface AddressSegmentSeriessetPrefixLength in class IPAddressSectionpublic IPv6AddressSection setPrefixLength(int networkPrefixLength, boolean withZeros)
setPrefixLength in class IPAddressSectionpublic IPv6AddressSection mask(IPv6AddressSection mask) throws AddressTypeException
AddressTypeExceptionpublic IPv6AddressSection removePrefixLength()
AddressSegmentSeriesremovePrefixLength in interface AddressSectionremovePrefixLength in interface AddressSegmentSeriesremovePrefixLength in class IPAddressSectionpublic IPv6AddressSection removePrefixLength(boolean zeroed)
removePrefixLength in class IPAddressSectionpublic IPv6AddressSection maskNetwork(IPv6AddressSection mask, int networkPrefixLength) throws AddressTypeException
bitwiseOr(IPv6AddressSection) or replace(IPv6AddressSection, int)mask - networkPrefixLength - AddressTypeExceptionpublic IPv6AddressSection bitwiseOr(IPv6AddressSection mask) throws AddressTypeException
mask - AddressTypeExceptionpublic IPv6AddressSection bitwiseOrNetwork(IPv6AddressSection mask, int networkPrefixLength) throws AddressTypeException
mask - AddressTypeExceptionpublic IPv6AddressSection getNetworkSection(int networkPrefixLength)
getNetworkSection in class IPAddressSectionpublic IPv6AddressSection getNetworkSection(int networkPrefixLength, boolean withPrefixLength)
getNetworkSection in class IPAddressSectionpublic IPv6AddressSection getHostSection(int networkPrefixLength)
getHostSection in class IPAddressSectionpublic java.lang.String toCompressedString()
toCompressedString in interface AddressSegmentSeriestoCompressedString in class IPAddressSectionpublic java.lang.String toCanonicalString()
toCanonicalString in interface AddressSegmentSeriespublic java.lang.String toMixedString()
public java.lang.String toFullString()
toFullString in class IPAddressSectionpublic java.lang.String toCompressedWildcardString()
IPAddressSectiontoCompressedWildcardString in class IPAddressSectionpublic java.lang.String toPrefixLengthString()
IPAddressSectiontoPrefixLengthString in class IPAddressSectionpublic java.lang.String toSubnetString()
IPAddressSectiontoSubnetString in class IPAddressSectionpublic java.lang.String toCanonicalWildcardString()
IPAddressSectiontoCanonicalWildcardString in class IPAddressSectionpublic java.lang.String toNormalizedWildcardString()
IPAddressSectiontoNormalizedWildcardString in class IPAddressSectionpublic java.lang.String toSQLWildcardString()
IPAddressSectiontoSQLWildcardString in class IPAddressSectionpublic java.lang.String toNormalizedString()
toNormalizedString in interface AddressComponentpublic java.lang.String toBase85String()
public java.lang.String toReverseDNSLookupString()
IPAddressSectiontoReverseDNSLookupString in class IPAddressSectionpublic java.lang.String toNormalizedString(IPAddressSection.IPStringOptions options)
toNormalizedString in class IPAddressSectionpublic java.lang.String toNormalizedString(IPv6AddressSection.IPv6StringOptions options)
public java.lang.String toNormalizedString(IPv6AddressSection.IPv6StringOptions options, java.lang.CharSequence zone)
public static java.lang.String toNormalizedString(IPAddressSection.IPStringOptions options, java.lang.CharSequence zone, IPAddressStringDivisionSeries part)
public IPAddressPartStringCollection toStandardStringCollection()
IPAddressSectiontoStandardStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toAllStringCollection()
IPAddressSectiontoAllStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toDatabaseSearchStringCollection()
IPAddressSectiontoDatabaseSearchStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toStringCollection(IPAddressSection.IPStringBuilderOptions options)
toStringCollection in class IPAddressSectionpublic IPAddressPartStringCollection toStringCollection(IPv6AddressSection.IPv6StringBuilderOptions opts)
public IPAddressStringDivisionSeries[] getParts(IPAddressSection.IPStringBuilderOptions opts)
IPAddressSectionIPAddressDivisionGroupinggetParts in class IPAddressSectionpublic IPAddressStringDivisionSeries[] getParts(IPv6AddressSection.IPv6StringBuilderOptions opts)
public IPAddressDivisionGrouping.RangeList getZeroSegments()
getZeroSegments in class IPAddressDivisionGroupingpublic IPAddressDivisionGrouping.RangeList getZeroRangeSegments()
getZeroRangeSegments in class IPAddressDivisionGroupingpublic boolean isZero()
isZero in interface AddressItemisZero in class AddressDivisionGrouping