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.WildcardOptions
IPAddressDivisionGrouping.Range, IPAddressDivisionGrouping.RangeList
AddressDivisionGrouping.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, toString
getDivision, getNetworkPrefixLength, getPrefixLength, isMore, isMultipleByNetworkPrefix, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefix
compareTo, getBytes, getBytes, getCount, getDivisionCount, getUpperBytes, getUpperBytes, hashCode, isMultiple, isRangeEquivalent
getDivision, getPrefixLength, isMore, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefix
getDivisionCount
getBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isMultiple
public 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)
AddressSegmentSeries
getSection
in interface AddressSection
getSection
in interface AddressSegmentSeries
getSection
in class IPAddressSection
public IPv6AddressSection getSection(int index, int endIndex)
AddressSegmentSeries
getSection
in interface AddressSection
getSection
in interface AddressSegmentSeries
getSection
in class IPAddressSection
public IPv6AddressSegment[] getSegments()
getSegments
in interface AddressSegmentSeries
getSegments
in class IPAddressSection
public IPv6AddressSection getLower()
IPAddressSection
getLower
in interface AddressComponent
getLower
in interface AddressSection
getLower
in interface AddressSegmentSeries
getLower
in class IPAddressSection
public IPv6AddressSection getUpper()
IPAddressSection
getUpper
in interface AddressComponent
getUpper
in interface AddressSection
getUpper
in interface AddressSegmentSeries
getUpper
in class IPAddressSection
public IPv6AddressSection reverseBits(boolean perByte)
AddressSegmentSeries
reverseBits
in interface AddressComponent
reverseBits
in interface AddressSection
reverseBits
in interface AddressSegmentSeries
reverseBits
in class IPAddressSection
perByte
- if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedpublic IPv6AddressSection reverseBytes()
AddressSegmentSeries
reverseBytes
in interface AddressComponent
reverseBytes
in interface AddressSection
reverseBytes
in interface AddressSegmentSeries
reverseBytes
in class IPAddressSection
public IPv6AddressSection reverseBytesPerSegment()
AddressSegmentSeries
reverseBytesPerSegment
in interface AddressSection
reverseBytesPerSegment
in interface AddressSegmentSeries
reverseBytesPerSegment
in class IPAddressSection
public IPv6AddressSection reverseSegments()
AddressSegmentSeries
reverseSegments
in interface AddressSection
reverseSegments
in interface AddressSegmentSeries
reverseSegments
in class IPAddressSection
public java.lang.Iterable<IPv6AddressSection> getIterable()
AddressComponent
AddressComponent.iterator()
directly.getIterable
in interface AddressComponent
getIterable
in interface AddressSection
getIterable
in interface AddressSegmentSeries
getIterable
in class IPAddressSection
public java.util.Iterator<IPv6AddressSection> iterator()
AddressComponent
AddressItem.isMultiple()
to determine if this instance represents multiple.
This method iterates through the individual elements.iterator
in interface AddressComponent
iterator
in interface AddressSection
iterator
in interface AddressSegmentSeries
iterator
in interface java.lang.Iterable<IPv6AddressSection>
iterator
in class IPAddressSection
public java.util.Iterator<IPv6AddressSegment[]> segmentsIterator()
segmentsIterator
in interface AddressSegmentSeries
segmentsIterator
in class IPAddressSection
public IPv6AddressSegment getSegment(int index)
getSegment
in interface AddressSegmentSeries
getSegment
in class IPAddressSection
public 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.IndexOutOfBoundsException
getEmbeddedIPv4AddressSection()
,
getMixedAddressSection()
public IPv4AddressSection getEmbeddedIPv4AddressSection()
getEmbeddedIPv4AddressSection(int, int)
,
getMixedAddressSection()
public IPv6AddressSection createNonMixedSection()
public IPv6AddressSection.IPv6v4MixedAddressSection getMixedAddressSection()
public int getBitsPerSegment()
getBitsPerSegment
in interface AddressSegmentSeries
public int getBytesPerSegment()
getBytesPerSegment
in interface AddressSegmentSeries
public boolean hasUppercaseVariations(int base, boolean lowerOnly)
public boolean isIPv6()
isIPv6
in class IPAddressSection
public IPAddress.IPVersion getIPVersion()
getIPVersion
in class IPAddressSection
public IPv6AddressSection replace(IPv6AddressSection other, int index)
public IPv6AddressSection prepend(IPv6AddressSection other)
public IPv6AddressSection append(IPv6AddressSection other)
public boolean contains(AddressSection other)
AddressSection
contains
in interface AddressSection
public boolean equals(java.lang.Object o)
equals
in class IPAddressDivisionGrouping
public IPv6AddressSection[] subtract(IPv6AddressSection other)
other
- AddressTypeException
- if the two sections are not comparablepublic int getByteIndex(int networkPrefixLength)
getByteIndex
in class IPAddressSection
public int getSegmentIndex(int networkPrefixLength)
getSegmentIndex
in class IPAddressSection
public IPv6AddressNetwork getNetwork()
getNetwork
in class IPAddressSection
public IPv6AddressSection adjustPrefixBySegment(boolean nextSegment)
AddressSegmentSeries
adjustPrefixBySegment
in interface AddressSection
adjustPrefixBySegment
in interface AddressSegmentSeries
adjustPrefixBySegment
in class IPAddressSection
public IPv6AddressSection adjustPrefixLength(int adjustment)
AddressSegmentSeries
adjustPrefixLength
in interface AddressSection
adjustPrefixLength
in interface AddressSegmentSeries
adjustPrefixLength
in class IPAddressSection
public IPv6AddressSection applyPrefixLength(int networkPrefixLength)
IPAddressSection
applyPrefixLength
in interface AddressSection
applyPrefixLength
in interface AddressSegmentSeries
applyPrefixLength
in class IPAddressSection
public IPv6AddressSection setPrefixLength(int networkPrefixLength)
AddressSegmentSeries
setPrefixLength
in interface AddressSection
setPrefixLength
in interface AddressSegmentSeries
setPrefixLength
in class IPAddressSection
public IPv6AddressSection setPrefixLength(int networkPrefixLength, boolean withZeros)
setPrefixLength
in class IPAddressSection
public IPv6AddressSection mask(IPv6AddressSection mask) throws AddressTypeException
AddressTypeException
public IPv6AddressSection removePrefixLength()
AddressSegmentSeries
removePrefixLength
in interface AddressSection
removePrefixLength
in interface AddressSegmentSeries
removePrefixLength
in class IPAddressSection
public IPv6AddressSection removePrefixLength(boolean zeroed)
removePrefixLength
in class IPAddressSection
public IPv6AddressSection maskNetwork(IPv6AddressSection mask, int networkPrefixLength) throws AddressTypeException
bitwiseOr(IPv6AddressSection)
or replace(IPv6AddressSection, int)
mask
- networkPrefixLength
- AddressTypeException
public IPv6AddressSection bitwiseOr(IPv6AddressSection mask) throws AddressTypeException
mask
- AddressTypeException
public IPv6AddressSection bitwiseOrNetwork(IPv6AddressSection mask, int networkPrefixLength) throws AddressTypeException
mask
- AddressTypeException
public IPv6AddressSection getNetworkSection(int networkPrefixLength)
getNetworkSection
in class IPAddressSection
public IPv6AddressSection getNetworkSection(int networkPrefixLength, boolean withPrefixLength)
getNetworkSection
in class IPAddressSection
public IPv6AddressSection getHostSection(int networkPrefixLength)
getHostSection
in class IPAddressSection
public java.lang.String toCompressedString()
toCompressedString
in interface AddressSegmentSeries
toCompressedString
in class IPAddressSection
public java.lang.String toCanonicalString()
toCanonicalString
in interface AddressSegmentSeries
public java.lang.String toMixedString()
public java.lang.String toFullString()
toFullString
in class IPAddressSection
public java.lang.String toCompressedWildcardString()
IPAddressSection
toCompressedWildcardString
in class IPAddressSection
public java.lang.String toPrefixLengthString()
IPAddressSection
toPrefixLengthString
in class IPAddressSection
public java.lang.String toSubnetString()
IPAddressSection
toSubnetString
in class IPAddressSection
public java.lang.String toCanonicalWildcardString()
IPAddressSection
toCanonicalWildcardString
in class IPAddressSection
public java.lang.String toNormalizedWildcardString()
IPAddressSection
toNormalizedWildcardString
in class IPAddressSection
public java.lang.String toSQLWildcardString()
IPAddressSection
toSQLWildcardString
in class IPAddressSection
public java.lang.String toNormalizedString()
toNormalizedString
in interface AddressComponent
public java.lang.String toBase85String()
public java.lang.String toReverseDNSLookupString()
IPAddressSection
toReverseDNSLookupString
in class IPAddressSection
public java.lang.String toNormalizedString(IPAddressSection.IPStringOptions options)
toNormalizedString
in class IPAddressSection
public 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()
IPAddressSection
toStandardStringCollection
in class IPAddressSection
public IPAddressPartStringCollection toAllStringCollection()
IPAddressSection
toAllStringCollection
in class IPAddressSection
public IPAddressPartStringCollection toDatabaseSearchStringCollection()
IPAddressSection
toDatabaseSearchStringCollection
in class IPAddressSection
public IPAddressPartStringCollection toStringCollection(IPAddressSection.IPStringBuilderOptions options)
toStringCollection
in class IPAddressSection
public IPAddressPartStringCollection toStringCollection(IPv6AddressSection.IPv6StringBuilderOptions opts)
public IPAddressStringDivisionSeries[] getParts(IPAddressSection.IPStringBuilderOptions opts)
IPAddressSection
IPAddressDivisionGrouping
getParts
in class IPAddressSection
public IPAddressStringDivisionSeries[] getParts(IPv6AddressSection.IPv6StringBuilderOptions opts)
public IPAddressDivisionGrouping.RangeList getZeroSegments()
getZeroSegments
in class IPAddressDivisionGrouping
public IPAddressDivisionGrouping.RangeList getZeroRangeSegments()
getZeroRangeSegments
in class IPAddressDivisionGrouping
public boolean isZero()
isZero
in interface AddressItem
isZero
in class AddressDivisionGrouping