public class IPv6AddressSection extends IPAddressSection
| 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.StringOptions, IPAddressSection.WildcardOptionsIPAddressSegmentGrouping.Range, IPAddressSegmentGrouping.RangeList| Modifier and Type | Field and Description |
|---|---|
int |
startIndex |
| Constructor and Description |
|---|
IPv6AddressSection(byte[] bytes,
java.lang.Integer prefix) |
IPv6AddressSection(IPv6AddressSegment[] segments) |
IPv6AddressSection(IPv6AddressSegment[] segments,
java.lang.Integer networkPrefixLength) |
IPv6AddressSection(IPv6AddressSegment[] segments,
int startIndex,
java.lang.Integer networkPrefixLength) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(IPAddressSection other) |
IPv6AddressSection |
createNonMixedSection() |
boolean |
equals(java.lang.Object o) |
int |
getBitsPerSegment() |
int |
getByteIndex(java.lang.Integer 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() |
IPv6AddressSection |
getLowerSection()
If this represents an address section with ranging values, returns an address section representing the lower values of the range
If this represents an address section with a single value in each segment, returns this.
|
IPv6AddressSegment[] |
getLowerSegments()
If this represents an address section with ranging values, returns an array of address segments representing the lower values of the range
If this represents an address section with a single value in each segment, returns an array containing the segments for this section.
|
IPv6AddressSection.IPv6v4MixedAddressSection |
getMixedAddressSection() |
IPv6AddressNetwork |
getNetwork() |
IPv6AddressSection |
getNetworkSection(int networkPrefixLength) |
IPv6AddressSection |
getNetworkSection(int networkPrefixLength,
boolean withPrefixLength) |
IPAddressPart[] |
getParts(IPAddressSection.IPStringBuilderOptions opts)
Get all representations of this address including this IPAddressSection.
|
IPAddressPart[] |
getParts(IPv6AddressSection.IPv6StringBuilderOptions opts) |
IPv6AddressSegment |
getSegment(int index) |
int |
getSegmentIndex(java.lang.Integer networkPrefixLength) |
IPv6AddressSegment[] |
getSegments() |
IPv6AddressSection |
getUpperSection()
If this represents an address section with ranging values, returns an address section representing the upper values of the range
If this represents an address section with a single value in each segment, returns this.
|
IPv6AddressSegment[] |
getUpperSegments()
If this represents an address section with ranging values, returns an an array of address segments representing the upper values of the rang
If this represents an address section with a single value in each segment, returns an array containing the segments for this section.
|
IPAddressSegmentGrouping.RangeList |
getZeroRangeSegments() |
IPAddressSegmentGrouping.RangeList |
getZeroSegments() |
boolean |
hasAlphabeticDigits(int base,
boolean lowerOnly)
Returns whether this subnet or address has alphabetic digits when printed.
|
boolean |
isIPv6() |
boolean |
isZero() |
java.util.Iterator<IPv6AddressSegment[]> |
iterator() |
java.util.Iterator<IPv6AddressSection> |
sectionIterator() |
IPv6AddressSection[] |
subtract(IPAddressSection other)
Subtract the give subnet from this subnet, returning an array of sections for the result (the subnets will not be contiguous so an array is required).
|
IPAddressPartStringCollection |
toAllStringCollection()
Use this method with care...
|
java.lang.String |
toCanonicalString()
This produces a canonical string.
|
java.lang.String |
toCanonicalWildcardString()
This produces a string similar to the canonical string and avoids the CIDR prefix.
|
java.lang.String |
toCompressedString()
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
|
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 |
toNetworkPrefixLengthString()
Returns a string with a CIDR prefix length if this section has a network prefix length.
|
java.lang.String |
toNormalizedString()
The normalized string returned by this method is consistent with java.net.Inet6address.
|
java.lang.String |
toNormalizedString(IPAddressSection.StringOptions options) |
java.lang.String |
toNormalizedString(IPAddressSection.StringOptions options,
java.lang.String zone) |
java.lang.String |
toNormalizedString(IPv6AddressSection.IPv6StringOptions options) |
java.lang.String |
toNormalizedString(IPv6AddressSection.IPv6StringOptions options,
java.lang.String zone) |
java.lang.String |
toNormalizedStringRange(IPAddressSection.StringOptions options,
java.lang.String zone) |
java.lang.String |
toNormalizedStringRange(IPv6AddressSection.IPv6StringOptions options,
java.lang.String zone) |
java.lang.String |
toNormalizedWildcardString()
This produces a string similar to the normalized string and avoids the CIDR prefix.
|
java.lang.String |
toSQLWildcardString()
This is the same as the string from toNormalizedWildcardString except that:
-it uses IPAddress.SEGMENT_SQL_WILDCARD instead of IPAddress.SEGMENT_WILDCARD
-it uses IPAddress.SEGMENT_SQL_SINGLE_WILDCARD
|
IPAddressPartStringCollection |
toStandardStringCollection()
Returns at most a couple dozen string representations:
-mixed (1:2:3:4:5:6:1.2.3.4)
-upper and lower case
-full compressions or no compression (a:0:0:c:d:0:e:f or a::c:d:0:e:f or a:0:b:c:d::e:f)
-full leading zeros (000a:0000:000b:000c:000d:0000:000e:000f)
-combinations thereof
|
IPAddressPartStringCollection |
toStringCollection(IPAddressSection.IPStringBuilderOptions options) |
IPAddressPartStringCollection |
toStringCollection(IPv6AddressSection.IPv6StringBuilderOptions opts) |
IPv6AddressSection |
toSubnet(int networkPrefixLength)
Creates a subnet address using the given CIDR prefix bits.
|
IPv6AddressSection |
toSubnet(IPAddressSection mask)
Creates a subnet address using the given mask.
|
IPv6AddressSection |
toSubnet(IPAddressSection mask,
java.lang.Integer networkPrefixLength)
Creates a subnet address using the given mask.
|
java.lang.String |
toSubnetString()
Produces a consistent subnet string.
|
bitsPerSegment, bytesPerSegment, copySegments, getBitCount, getByteCount, getBytes, getEquivalentPrefix, getHostBits, getLowestBytes, getMaskPrefixLength, getMinPrefix, getSegmentCount, getSegmentPrefixLength, getSegmentPrefixLength, getSegmentStrings, getStartsWithSQLClause, getStartsWithSQLClause, isContainedBy, isDecimalSameAsOctal, isEntireAddress, isIPv4, isMaskCompatibleWithRange, toHexString, toMinimalPrefixed, toNormalizedString, toPrefixedEquivalent, toString, toSupernet, toSupernetcompareTo, getCount, getDivision, getDivisionCount, getNetworkPrefixLength, hashCode, isMultiple, isMultipleByNetworkPrefix, isPrefixed, isRangeEquivalentToPrefixgetPrefixStringLengthpublic IPv6AddressSection(IPv6AddressSegment[] segments)
public IPv6AddressSection(IPv6AddressSegment[] segments, java.lang.Integer networkPrefixLength)
public IPv6AddressSection(IPv6AddressSegment[] segments, int startIndex, java.lang.Integer networkPrefixLength)
public IPv6AddressSection(byte[] bytes,
java.lang.Integer prefix)
public IPv6AddressSegment[] getSegments()
getSegments in class IPAddressSectionpublic IPv6AddressSegment[] getLowerSegments()
IPAddressSectiongetLowerSegments in class IPAddressSectionpublic IPv6AddressSegment[] getUpperSegments()
IPAddressSectiongetUpperSegments in class IPAddressSectionpublic IPv6AddressSection getLowerSection()
IPAddressSectiongetLowerSection in class IPAddressSectionpublic IPv6AddressSection getUpperSection()
IPAddressSectiongetUpperSection in class IPAddressSectionpublic java.util.Iterator<IPv6AddressSection> sectionIterator()
sectionIterator in class IPAddressSectionpublic java.util.Iterator<IPv6AddressSegment[]> iterator()
iterator in class IPAddressSectionpublic IPv6AddressSegment getSegment(int index)
getSegment in class IPAddressSectionpublic 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 class IPAddressSectionpublic int getBytesPerSegment()
getBytesPerSegment in class IPAddressSectionpublic boolean hasAlphabeticDigits(int base,
boolean lowerOnly)
public boolean isIPv6()
isIPv6 in class IPAddressSectionpublic IPAddress.IPVersion getIPVersion()
getIPVersion in class IPAddressSectionpublic boolean contains(IPAddressSection other)
contains in class IPAddressSectionpublic boolean equals(java.lang.Object o)
equals in class IPAddressSegmentGroupingpublic IPv6AddressSection[] subtract(IPAddressSection other)
IPAddressSectionsubtract in class IPAddressSectionpublic int getByteIndex(java.lang.Integer networkPrefixLength)
getByteIndex in class IPAddressSectionpublic int getSegmentIndex(java.lang.Integer networkPrefixLength)
getSegmentIndex in class IPAddressSectionpublic IPv6AddressNetwork getNetwork()
getNetwork in class IPAddressSectionpublic IPv6AddressSection toSubnet(int networkPrefixLength) throws IPAddressTypeException
IPAddressSectiontoSubnet in class IPAddressSectionIPAddressTypeExceptionpublic IPv6AddressSection toSubnet(IPAddressSection mask) throws IPAddressTypeException
toSubnet in class IPAddressSectionIPAddressTypeExceptionpublic IPv6AddressSection toSubnet(IPAddressSection mask, java.lang.Integer networkPrefixLength) throws IPAddressTypeException
toSubnet in class IPAddressSectionIPAddressTypeException - if the mask is not compatible, see IPAddress.isMaskCompatibleWithRange(IPAddress, Integer)public 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 class IPAddressSectionpublic java.lang.String toCanonicalString()
toCanonicalString in class IPAddressSectionpublic java.lang.String toMixedString()
public java.lang.String toFullString()
toFullString in class IPAddressSectionpublic java.lang.String toCompressedWildcardString()
IPAddressSectiontoCompressedWildcardString in class IPAddressSectionpublic java.lang.String toNetworkPrefixLengthString()
IPAddressSectiontoNetworkPrefixLengthString 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 class IPAddressSectionpublic java.lang.String toNormalizedStringRange(IPAddressSection.StringOptions options, java.lang.String zone)
public java.lang.String toNormalizedStringRange(IPv6AddressSection.IPv6StringOptions options, java.lang.String zone)
public java.lang.String toNormalizedString(IPAddressSection.StringOptions options)
toNormalizedString in class IPAddressSectionpublic java.lang.String toNormalizedString(IPAddressSection.StringOptions options, java.lang.String zone)
public java.lang.String toNormalizedString(IPv6AddressSection.IPv6StringOptions options)
public java.lang.String toNormalizedString(IPv6AddressSection.IPv6StringOptions options, java.lang.String zone)
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 IPAddressPart[] getParts(IPAddressSection.IPStringBuilderOptions opts)
IPAddressSectiongetParts in class IPAddressSectionpublic IPAddressPart[] getParts(IPv6AddressSection.IPv6StringBuilderOptions opts)
public IPAddressSegmentGrouping.RangeList getZeroSegments()
getZeroSegments in class IPAddressSegmentGroupingpublic IPAddressSegmentGrouping.RangeList getZeroRangeSegments()
getZeroRangeSegments in class IPAddressSegmentGroupingpublic boolean isZero()
isZero in class IPAddressSegmentGrouping