public abstract class IPAddressSection extends IPAddressDivisionGrouping implements IPAddressSegmentSeries, AddressSection
IPAddressSection objects are immutable. Some of the derived state is created upon demand and cached. This also makes them thread-safe. Almost all operations that can be performed on IPAddress objects can also be performed on IPAddressSection objects and vice-versa.
| Modifier and Type | Class and Description |
|---|---|
static class |
IPAddressSection.IPStringBuilderOptions
This user-facing class is designed to be a clear way to create a collection of strings.
|
static class |
IPAddressSection.IPStringOptions
Represents a clear way to create a specific type of string.
|
static interface |
IPAddressSection.SegFunction<R,S> |
static class |
IPAddressSection.WildcardOptions |
IPAddressDivisionGrouping.Range, IPAddressDivisionGrouping.RangeListAddressDivisionGrouping.StringOptions| Modifier and Type | Method and Description |
|---|---|
abstract IPAddressSection |
adjustPrefixBySegment(boolean nextSegment)
Increases or decreases prefix length to the next segment boundary.
|
IPAddressSection |
adjustPrefixBySegment(boolean nextSegment,
boolean zeroed)
Increases or decreases prefix length to the next segment boundary.
|
abstract IPAddressSection |
adjustPrefixLength(int adjustment)
Increases or decreases prefix length by the given increment.
|
abstract IPAddressSection |
adjustPrefixLength(int adjustment,
boolean zeroed)
Increases or decreases prefix length by the given increment.
|
abstract IPAddressSection |
applyPrefixLength(int networkPrefixLength)
Applies the given prefix length to create a new segment series.
|
IPAddressSection |
assignMinPrefixForBlock()
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.
|
IPAddressSection |
assignPrefixForSingleBlock()
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.
|
static int |
bitsPerSegment(IPAddress.IPVersion version) |
static int |
bytesPerSegment(IPAddress.IPVersion version) |
boolean |
contains(AddressSection other)
Determines if one section contains another.
|
boolean |
containsPrefixBlock(int prefixLength)
Returns whether the values of this division grouping contain the prefix block for the given prefix length
|
int |
getBitCount() |
java.lang.Integer |
getBlockMaskPrefixLength(boolean network)
If this address section is equivalent to the mask for a CIDR prefix block, it returns that prefix length.
|
int |
getByteCount()
returns the number of bytes in each of the address components represented by this instance
|
java.math.BigInteger |
getCountImpl() |
IPAddressSegment |
getDivision(int index) |
java.lang.Integer |
getHostBitCount() |
java.lang.Integer |
getHostSegmentCount() |
abstract java.lang.Iterable<? extends IPAddressSection> |
getIterable()
Useful for using an instance in a "for-each loop".
|
abstract IPAddressSection |
getLower()
If this represents a series with ranging values, returns a series representing the lower values of the range.
|
abstract IPAddressSection |
getLowerNonZeroHost()
Similar to
IPAddressSegmentSeries.getLower(), but will not return a series that has a prefix length and whose host value is zero. |
int |
getMinPrefixLengthForBlock()
Returns the smallest CIDR prefix length possible (largest network) for which this includes the block of address sections for that prefix.
|
java.lang.Integer |
getNetworkSegmentCount() |
java.math.BigInteger |
getNonZeroHostCount()
Gets the count of single value series that this series may represent.
|
IPAddressStringDivisionSeries[] |
getParts(IPAddressSection.IPStringBuilderOptions options)
Get all representations of this address including this IPAddressSection.
|
java.lang.Integer |
getPrefixLengthForSingleBlock()
Returns a prefix length for which the range of this address section matches the the block of addresses for that prefix.
|
abstract IPAddressSection |
getSection(int index)
Gets the subsection from the series starting from the given index
|
abstract IPAddressSection |
getSection(int index,
int endIndex)
Gets the subsection from the series starting from the given index and ending just before the give endIndex
|
IPAddressSegment |
getSegment(int index)
Returns the segment from this series at the given index.
|
int |
getSegmentCount()
Returns the number of segments in this series.
|
static java.lang.Integer |
getSegmentPrefixLength(int bitsPerSegment,
java.lang.Integer prefixLength,
int segmentIndex)
Across the address prefixes are:
IPv6: (null):...:(null):(1 to 16):(0):...:(0)
or IPv4: ...(null).(1 to 8).(0)...
|
void |
getSegments(AddressSegment[] segs)
Copies the existing segments into the given array.
|
void |
getSegments(int start,
int end,
AddressSegment[] segs,
int destIndex)
get the segments from start to end and insert into the segs array at the the given index
|
java.lang.String[] |
getSegmentStrings()
Returns the an array with the values of each segment as they would appear in the normalized with wildcards string.
|
void |
getStartsWithSQLClause(java.lang.StringBuilder builder,
java.lang.String expression)
This method gives you an SQL clause that allows you to search the database for the front part of an address or
addresses in a given network.
|
void |
getStartsWithSQLClause(java.lang.StringBuilder builder,
java.lang.String expression,
IPAddressSQLTranslator translator) |
abstract IPAddressSection |
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 |
includesMaxHost()
Returns whether the series has a host of all ones.
|
boolean |
includesMaxHost(int networkPrefixLength)
Returns whether all bits past the given prefix length are all ones.
|
boolean |
includesZeroHost()
Returns whether the series has a host of zero.
|
boolean |
includesZeroHost(int networkPrefixLength)
Returns whether all bits past the given prefix length are zero.
|
abstract IPAddressSection |
increment(long increment)
Returns the series from the subnet that is the given increment upwards into the subnet range,
or if the given increment is negative the given increment downwards into the subnet range,
or if this is just an individual series, it simply adds the increment to this.
|
boolean |
isEntireAddress() |
boolean |
isFullRange() |
boolean |
isIPv4() |
boolean |
isIPv6() |
boolean |
isSingleNetwork() |
abstract java.util.Iterator<? extends IPAddressSection> |
iterator()
Iterates through the individual segment series.
|
boolean |
matchesWithMask(IPAddressSection other,
IPAddressSection mask)
Applies the mask to this address section and then compares values with the given address section
|
abstract java.util.Iterator<? extends IPAddressSection> |
nonZeroHostIterator() |
abstract java.util.Iterator<? extends IPAddressSection> |
prefixBlockIterator()
Iterates through the individual prefix blocks.
|
abstract IPAddressSection |
removePrefixLength()
Removes the prefix length.
|
abstract IPAddressSection |
removePrefixLength(boolean zeroed)
Removes the prefix length.
|
abstract IPAddressSection |
reverseBits(boolean perByte)
Returns a new series which has the bits reversed.
|
abstract IPAddressSection |
reverseBytes()
Returns a new segment series with the bytes reversed.
|
abstract IPAddressSection |
reverseBytesPerSegment()
Returns a new segment series with the bytes reversed within each segment.
|
abstract IPAddressSection |
reverseSegments()
Returns a new segment series with the segments reversed.
|
abstract IPAddressSection |
setPrefixLength(int prefixLength)
Sets the prefix length.
|
abstract IPAddressSection |
setPrefixLength(int prefixLength,
boolean zeroed)
Sets the prefix length.
|
IPAddressPartStringCollection |
toAllStringCollection()
Use this method with care...
|
java.lang.String |
toBinaryString()
Writes this IP address segment series as a single binary value with always the exact same number of characters
If this section represents a range of values outside of the network prefix length, then this is printed as a range of two hex values.
|
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 |
toHexString(boolean with0xPrefix)
Writes this address component as a single hexadecimal value with always the exact same number of characters, with or without a preceding 0x prefix.
|
abstract IPAddressSection |
toMaxHost()
Returns the segment series with a host of all ones.
|
abstract IPAddressSection |
toMaxHost(int prefixLength)
Produces the series with host values of all one bits for the given prefix length.
|
java.lang.String |
toNormalizedString(IPAddressSection.IPStringOptions stringOptions)
Creates a customized string from this series.
|
static java.lang.String |
toNormalizedString(IPAddressSection.IPStringOptions opts,
IPAddressStringDivisionSeries section) |
java.lang.String |
toOctalString(boolean with0Prefix)
Writes this IP address segment series as a single octal value with always the exact same number of characters, with or without a preceding 0 prefix.
|
abstract IPAddressSection |
toPrefixBlock()
If this series has a prefix length, returns the subnet block for that prefix.
|
abstract IPAddressSection |
toPrefixBlock(int networkPrefixLength)
Returns the segment series of the same length that spans all hosts.
|
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
|
java.lang.String |
toString() |
abstract IPAddressSection |
toZeroHost()
Returns the segment series with a host of zero.
|
abstract IPAddressSection |
toZeroHost(int prefixLength)
Produces the series with host values of 0 for the given prefix length.
|
containsSinglePrefixBlock, equals, getNetwork, getNetworkPrefixLength, getPrefixLength, getZeroRangeSegments, getZeroSegments, isMore, isPrefixBlock, isPrefixed, isSinglePrefixBlockcompareTo, getBytes, getBytes, getCount, getDivisionCount, getDivisionStrings, getPrefixCount, getUpperBytes, getUpperBytes, getUpperValue, getValue, hashCode, includesMax, includesZero, isMax, isMultiple, isZerogetHostSection, getHostSection, getIPVersion, getNetwork, getNetworkPrefixLength, getNetworkSection, getNetworkSection, getNetworkSection, getSection, getSegments, segmentsIterator, segmentsNonZeroHostIterator, toCanonicalWildcardString, toCompressedWildcardString, toFullString, toNormalizedWildcardString, toPrefixLengthString, toReverseDNSLookupString, toSQLWildcardString, toStringCollection, toSubnetStringgetBitsPerSegment, getBytesPerSegment, toCanonicalString, toCompressedStringcontainsSinglePrefixBlock, getDivisionStrings, getPrefixCount, getPrefixLength, getUpperValue, getValue, isMore, isPrefixBlock, isPrefixed, isSinglePrefixBlockgetDivisionCounttoNormalizedStringgetBytes, getBytes, getCount, getUpperBytes, getUpperBytes, includesMax, includesZero, isMax, isMultiple, isZeropublic int getBitCount()
getBitCount in interface AddressItemgetBitCount in class AddressDivisionGroupingpublic int getByteCount()
AddressComponentgetByteCount in interface AddressComponentpublic static int bitsPerSegment(IPAddress.IPVersion version)
public static int bytesPerSegment(IPAddress.IPVersion version)
public java.math.BigInteger getNonZeroHostCount()
IPAddressSegmentSeriesAddressItem.getCount().getNonZeroHostCount in interface IPAddressSegmentSeriespublic java.math.BigInteger getCountImpl()
public boolean isIPv4()
public boolean isIPv6()
public java.lang.Integer getBlockMaskPrefixLength(boolean network)
network - whether to check for a network mask or a host maskpublic java.lang.Integer getNetworkSegmentCount()
public java.lang.Integer getHostSegmentCount()
public java.lang.Integer getHostBitCount()
public static java.lang.Integer getSegmentPrefixLength(int bitsPerSegment,
java.lang.Integer prefixLength,
int segmentIndex)
public int getSegmentCount()
AddressSegmentSeriesgetSegmentCount in interface AddressSegmentSeriespublic IPAddressSegment getSegment(int index)
AddressSegmentSeriesgetSegment in interface AddressSegmentSeriesgetSegment in interface IPAddressSegmentSeriespublic IPAddressSegment getDivision(int index)
getDivision in interface AddressDivisionSeriesgetDivision in interface AddressStringDivisionSeriesgetDivision in interface IPAddressStringDivisionSeriesgetDivision in class IPAddressDivisionGroupingpublic boolean containsPrefixBlock(int prefixLength)
AddressDivisionGroupingcontainsPrefixBlock in interface AddressDivisionSeriescontainsPrefixBlock in class IPAddressDivisionGroupingpublic boolean contains(AddressSection other)
AddressSectioncontains in interface AddressSectionother - public boolean isFullRange()
isFullRange in interface AddressItemisFullRange in class AddressDivisionGroupingpublic abstract IPAddressSection toZeroHost()
IPAddressSegmentSeries
The resultant series will have the same prefix length if AddressNetwork.getPrefixConfiguration() is not AddressNetwork.PrefixConfiguration.ALL_PREFIXED_ADDRESSES_ARE_SUBNETS,
otherwise it will no longer have a prefix length.
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
toZeroHost in interface IPAddressSegmentSeriespublic abstract IPAddressSection toZeroHost(int prefixLength)
IPAddressSegmentSeriesIf 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
toZeroHost in interface IPAddressSegmentSeriespublic abstract IPAddressSection toMaxHost()
IPAddressSegmentSeries
The resultant series will have the same prefix length if AddressNetwork.getPrefixConfiguration() is not AddressNetwork.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
toMaxHost in interface IPAddressSegmentSeriespublic abstract IPAddressSection toMaxHost(int prefixLength)
IPAddressSegmentSeriesIf 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
toMaxHost in interface IPAddressSegmentSeriespublic abstract IPAddressSection applyPrefixLength(int networkPrefixLength) throws PrefixLenException
AddressSegmentSeries
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.
applyPrefixLength in interface AddressSectionapplyPrefixLength in interface AddressSegmentSeriesapplyPrefixLength in interface IPAddressSegmentSeriesPrefixLenExceptionAddressSegmentSeries.setPrefixLength(int)public abstract IPAddressSection toPrefixBlock()
IPAddressSegmentSeriestoPrefixBlock in interface AddressSectiontoPrefixBlock in interface AddressSegmentSeriestoPrefixBlock in interface IPAddressSegmentSeriespublic abstract IPAddressSection toPrefixBlock(int networkPrefixLength)
IPAddressSegmentSeriestoPrefixBlock in interface IPAddressSegmentSeriespublic IPAddressSection assignPrefixForSingleBlock()
If no such prefix length exists, returns null.
If this address represents just a single address, "this" is returned.
assignPrefixForSingleBlock in interface IPAddressSegmentSeriesIPAddressSegmentSeries.toPrefixBlock(),
IPAddressSegmentSeries.assignMinPrefixForBlock()public IPAddressSection assignMinPrefixForBlock()
assignMinPrefixForBlock in interface IPAddressSegmentSeriesIPAddressSegmentSeries.toPrefixBlock(),
IPAddressSegmentSeries.assignPrefixForSingleBlock()public boolean includesZeroHost()
IPAddressSegmentSeriesincludesZeroHost in interface IPAddressSegmentSeriesincludesZeroHost in class IPAddressDivisionGroupingpublic boolean includesZeroHost(int networkPrefixLength)
IPAddressSegmentSeriesincludesZeroHost in interface IPAddressSegmentSeriespublic boolean includesMaxHost()
IPAddressSegmentSeriesincludesMaxHost in interface IPAddressSegmentSeriespublic boolean includesMaxHost(int networkPrefixLength)
IPAddressSegmentSeriesincludesMaxHost in interface IPAddressSegmentSeriespublic boolean isSingleNetwork()
public boolean matchesWithMask(IPAddressSection other, IPAddressSection mask)
mask - other - public abstract IPAddressSection removePrefixLength(boolean zeroed)
IPAddressSegmentSeriesIPAddressSegmentSeries.removePrefixLength()removePrefixLength in interface AddressSectionremovePrefixLength in interface AddressSegmentSeriesremovePrefixLength in interface IPAddressSegmentSerieszeroed - whether the host bits become zero.public abstract IPAddressSection removePrefixLength()
IPAddressSegmentSeriesremovePrefixLength in interface AddressSectionremovePrefixLength in interface AddressSegmentSeriesremovePrefixLength in interface IPAddressSegmentSeriesIPAddressSegmentSeries.removePrefixLength(boolean)public IPAddressSection adjustPrefixBySegment(boolean nextSegment, boolean zeroed)
AddressSegmentSeriesadjustPrefixBySegment in interface AddressSectionadjustPrefixBySegment in interface AddressSegmentSeriesadjustPrefixBySegment in interface IPAddressSegmentSeriesnextSegment - whether to move prefix to previous or following segment coundaryzeroed - whether the bits that move from one side of the prefix to the other become zero or retain their original valuespublic abstract IPAddressSection adjustPrefixBySegment(boolean nextSegment)
AddressSegmentSeries
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.
adjustPrefixBySegment in interface AddressSectionadjustPrefixBySegment in interface AddressSegmentSeriesadjustPrefixBySegment in interface IPAddressSegmentSeriesnextSegment - whether to move prefix to previous or following segment coundarypublic abstract IPAddressSection adjustPrefixLength(int adjustment)
AddressSegmentSeriesWhen 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.
adjustPrefixLength in interface AddressSectionadjustPrefixLength in interface AddressSegmentSeriesadjustPrefixLength in interface IPAddressSegmentSeriespublic abstract IPAddressSection adjustPrefixLength(int adjustment, boolean zeroed)
AddressSegmentSeriesadjustPrefixLength in interface AddressSectionadjustPrefixLength in interface AddressSegmentSeriesadjustPrefixLength in interface IPAddressSegmentSeriesadjustment - the incrementzeroed - whether the bits that move from one side of the prefix to the other become zero or retain their original valuespublic abstract IPAddressSection setPrefixLength(int prefixLength)
AddressSegmentSeriesIf this series has a prefix length, and the 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.
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.
setPrefixLength in interface AddressSectionsetPrefixLength in interface AddressSegmentSeriessetPrefixLength in interface IPAddressSegmentSeriesAddressSegmentSeries.applyPrefixLength(int)public abstract IPAddressSection setPrefixLength(int prefixLength, boolean zeroed)
AddressSegmentSeriesWhen the prefix is extended beyond the segment series boundary, it is removed.
setPrefixLength in interface AddressSectionsetPrefixLength in interface AddressSegmentSeriessetPrefixLength in interface IPAddressSegmentSerieszeroed - 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.public int getMinPrefixLengthForBlock()
getMinPrefixLengthForBlock in interface AddressDivisionSeriesgetMinPrefixLengthForBlock in class AddressDivisionGroupingIPAddressDivision.getBlockMaskPrefixLength(boolean)public java.lang.Integer getPrefixLengthForSingleBlock()
If no such prefix exists, returns null
If this address section represents a single value, returns the bit length
getPrefixLengthForSingleBlock in interface AddressDivisionSeriesgetPrefixLengthForSingleBlock in class IPAddressDivisionGroupingpublic abstract IPAddressSection getLowerNonZeroHost()
IPAddressSegmentSeriesIPAddressSegmentSeries.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 as IPAddressSegmentSeries.getLower().getLowerNonZeroHost in interface IPAddressSegmentSeriespublic abstract IPAddressSection getLower()
AddressSegmentSeriesgetLower in interface AddressComponentgetLower in interface AddressSectiongetLower in interface AddressSegmentSeriesgetLower in interface IPAddressSegmentSeriespublic abstract IPAddressSection getUpper()
AddressSegmentSeriesgetUpper in interface AddressComponentgetUpper in interface AddressSectiongetUpper in interface AddressSegmentSeriesgetUpper in interface IPAddressSegmentSeriespublic abstract IPAddressSection reverseSegments()
AddressSegmentSeriesIncompatibleAddressException since all address series can reverse their segments.reverseSegments in interface AddressSectionreverseSegments in interface AddressSegmentSeriesreverseSegments in interface IPAddressSegmentSeriespublic abstract IPAddressSection reverseBits(boolean perByte)
IPAddressSegmentSeriesIf 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 call IPAddressSegmentSeries.iterator(), IPAddressSegmentSeries.getLower(), IPAddressSegmentSeries.getUpper() or some other method to transform the address
into an address representing a single value before reversing.
reverseBits in interface AddressComponentreverseBits in interface AddressSectionreverseBits in interface AddressSegmentSeriesreverseBits in interface IPAddressSegmentSeriesperByte - if true, only the bits in each byte are reversed, if false, then all bits in the address are reversedpublic abstract IPAddressSection reverseBytes()
AddressSegmentSeriesreverseBytes in interface AddressComponentreverseBytes in interface AddressSectionreverseBytes in interface AddressSegmentSeriesreverseBytes in interface IPAddressSegmentSeriespublic abstract IPAddressSection reverseBytesPerSegment()
AddressSegmentSeriesreverseBytesPerSegment in interface AddressSectionreverseBytesPerSegment in interface AddressSegmentSeriesreverseBytesPerSegment in interface IPAddressSegmentSeriespublic abstract IPAddressSection getSection(int index)
AddressSegmentSeriesgetSection in interface AddressSegmentSeriesgetSection in interface IPAddressSegmentSeriespublic abstract IPAddressSection getSection(int index, int endIndex)
AddressSegmentSeriesgetSection in interface AddressSegmentSeriesgetSection in interface IPAddressSegmentSeriespublic void getSegments(AddressSegment[] segs)
AddressSegmentSeriesAddressSegmentSeries.getSegmentCount()getSegments in interface AddressSegmentSeriespublic void getSegments(int start,
int end,
AddressSegment[] segs,
int destIndex)
AddressSegmentSeriesgetSegments in interface AddressSegmentSeriesstart - the first segment index from this series to be includedend - the first segment index to be excludedsegs - the target arraydestIndex - where to insert the segments in the segs arraypublic abstract java.lang.Iterable<? extends IPAddressSection> getIterable()
AddressComponentAddressComponent.iterator() directly.getIterable in interface AddressComponentgetIterable in interface AddressSectiongetIterable in interface AddressSegmentSeriesgetIterable in interface IPAddressSegmentSeriespublic abstract java.util.Iterator<? extends IPAddressSection> nonZeroHostIterator()
nonZeroHostIterator in interface IPAddressSegmentSeriespublic abstract java.util.Iterator<? extends IPAddressSection> iterator()
AddressSegmentSeriesiterator in interface AddressComponentiterator in interface AddressSectioniterator in interface AddressSegmentSeriesiterator in interface IPAddressSegmentSeriespublic abstract java.util.Iterator<? extends IPAddressSection> prefixBlockIterator()
AddressSegmentSeriesAddressSegmentSeries.iterator()prefixBlockIterator in interface AddressSectionprefixBlockIterator in interface AddressSegmentSeriesprefixBlockIterator in interface IPAddressSegmentSeriespublic abstract IPAddressSection increment(long increment)
AddressSegmentSeriesIf the subnet has multiple values and the increment exceeds the subnet size, then the amount by which is exceeds the size is added to the upper series of the range (the final iterator value) or is subtracted from the lower series of the range (the first iterator value) if negative.
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 iterator. For instance, a increment of 1 is value 1 from the iterator, an increment of 2 is the second value from the iterator, and so on. A negative increment is equivalent to the same number of values preceding the upper bound of the iterator. For instance, an increment of -1 is the last value from the iterator, and increment of -2 is the second last value, and so on.
Therefore, to get the series just above the highest series of the subnet, use an increment of size:count > 1 ? count + 1 : 1 where count is the subnet size.
To get the series just below the lowest series of the subnet, use an increment of size:-(count > 1 ? count + 1 : 1) where count is the subnet size.
increment in interface AddressSectionincrement in interface AddressSegmentSeriesincrement in interface IPAddressSegmentSeriespublic boolean isEntireAddress()
public java.lang.String toString()
toString in class AddressDivisionGroupingpublic java.lang.String[] getSegmentStrings()
AddressSegmentSeriesgetSegmentStrings in interface AddressSegmentSeriespublic java.lang.String toBinaryString()
IPAddressSegmentSeriestoBinaryString in interface IPAddressSegmentSeriespublic java.lang.String toOctalString(boolean with0Prefix)
IPAddressSegmentSeriestoOctalString in interface IPAddressSegmentSeriespublic java.lang.String toHexString(boolean with0xPrefix)
AddressComponentIf this component represents a range of values outside of the network prefix length, then this is printed as a range of two hex values.
For instance, for IPv4 addresses there are 8 hex characters, for IPv6 addresses there are 32 hex characters.
toHexString in interface AddressComponentpublic java.lang.String toNormalizedString(IPAddressSection.IPStringOptions stringOptions)
IPAddressSegmentSeriestoNormalizedString in interface IPAddressSegmentSeriespublic static java.lang.String toNormalizedString(IPAddressSection.IPStringOptions opts, IPAddressStringDivisionSeries section)
public IPAddressPartStringCollection toStandardStringCollection()
public IPAddressPartStringCollection toAllStringCollection()
public IPAddressPartStringCollection toDatabaseSearchStringCollection()
public IPAddressStringDivisionSeries[] getParts(IPAddressSection.IPStringBuilderOptions options)
IPAddressDivisionGroupingoptions - public void getStartsWithSQLClause(java.lang.StringBuilder builder,
java.lang.String expression)
getStartsWithSQLClause(StringBuilder, String, IPAddressSQLTranslator)builder - expression - the expression that must match the condition, whether a column name or otherpublic void getStartsWithSQLClause(java.lang.StringBuilder builder,
java.lang.String expression,
IPAddressSQLTranslator translator)