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.WildcardOptions
IPAddressSegmentGrouping.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, toSupernet
compareTo, getCount, getDivision, getDivisionCount, getNetworkPrefixLength, hashCode, isMultiple, isMultipleByNetworkPrefix, isPrefixed, isRangeEquivalentToPrefix
getPrefixStringLength
public 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 IPAddressSection
public IPv6AddressSegment[] getLowerSegments()
IPAddressSection
getLowerSegments
in class IPAddressSection
public IPv6AddressSegment[] getUpperSegments()
IPAddressSection
getUpperSegments
in class IPAddressSection
public IPv6AddressSection getLowerSection()
IPAddressSection
getLowerSection
in class IPAddressSection
public IPv6AddressSection getUpperSection()
IPAddressSection
getUpperSection
in class IPAddressSection
public java.util.Iterator<IPv6AddressSection> sectionIterator()
sectionIterator
in class IPAddressSection
public java.util.Iterator<IPv6AddressSegment[]> iterator()
iterator
in class IPAddressSection
public IPv6AddressSegment getSegment(int index)
getSegment
in class IPAddressSection
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 class IPAddressSection
public int getBytesPerSegment()
getBytesPerSegment
in class IPAddressSection
public boolean hasAlphabeticDigits(int base, boolean lowerOnly)
public boolean isIPv6()
isIPv6
in class IPAddressSection
public IPAddress.IPVersion getIPVersion()
getIPVersion
in class IPAddressSection
public boolean contains(IPAddressSection other)
contains
in class IPAddressSection
public boolean equals(java.lang.Object o)
equals
in class IPAddressSegmentGrouping
public IPv6AddressSection[] subtract(IPAddressSection other)
IPAddressSection
subtract
in class IPAddressSection
public int getByteIndex(java.lang.Integer networkPrefixLength)
getByteIndex
in class IPAddressSection
public int getSegmentIndex(java.lang.Integer networkPrefixLength)
getSegmentIndex
in class IPAddressSection
public IPv6AddressNetwork getNetwork()
getNetwork
in class IPAddressSection
public IPv6AddressSection toSubnet(int networkPrefixLength) throws IPAddressTypeException
IPAddressSection
toSubnet
in class IPAddressSection
IPAddressTypeException
public IPv6AddressSection toSubnet(IPAddressSection mask) throws IPAddressTypeException
toSubnet
in class IPAddressSection
IPAddressTypeException
public IPv6AddressSection toSubnet(IPAddressSection mask, java.lang.Integer networkPrefixLength) throws IPAddressTypeException
toSubnet
in class IPAddressSection
IPAddressTypeException
- if the mask is not compatible, see IPAddress.isMaskCompatibleWithRange(IPAddress, Integer)
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 class IPAddressSection
public java.lang.String toCanonicalString()
toCanonicalString
in class IPAddressSection
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 toNetworkPrefixLengthString()
IPAddressSection
toNetworkPrefixLengthString
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 class IPAddressSection
public 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 IPAddressSection
public 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()
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 IPAddressPart[] getParts(IPAddressSection.IPStringBuilderOptions opts)
IPAddressSection
getParts
in class IPAddressSection
public IPAddressPart[] getParts(IPv6AddressSection.IPv6StringBuilderOptions opts)
public IPAddressSegmentGrouping.RangeList getZeroSegments()
getZeroSegments
in class IPAddressSegmentGrouping
public IPAddressSegmentGrouping.RangeList getZeroRangeSegments()
getZeroRangeSegments
in class IPAddressSegmentGrouping
public boolean isZero()
isZero
in class IPAddressSegmentGrouping