- All Superinterfaces:
AddressItem
,AddressItemRange
,Comparable<AddressItem>
,Serializable
- All Known Subinterfaces:
AddressComponent
,AddressSection
,AddressSegment
,AddressSegmentSeries
,IPAddressRange
,IPAddressSegmentSeries
- All Known Implementing Classes:
Address
,IPAddress
,IPAddressSection
,IPAddressSegment
,IPAddressSeqRange
,IPv4Address
,IPv4AddressSection
,IPv4AddressSegment
,IPv4AddressSeqRange
,IPv6Address
,IPv6AddressSection
,IPv6AddressSegment
,IPv6AddressSeqRange
,MACAddress
,MACAddressSection
,MACAddressSegment
Represents a range of address components
- Author:
- seancfoley
-
Method Summary
Modifier and TypeMethodDescriptionIterable
<? extends AddressComponent> Useful for using an instance in a "for-each loop".getLower()
If this instance represents multiple address items, returns the one with the lowest numeric value.getUpper()
If this instance represents multiple address items, returns the one with the highest numeric value.Iterator
<? extends AddressComponent> iterator()
Iterates through the individual address components.AddressComponentRangeSpliterator
<? extends AddressComponentRange, ? extends AddressComponent> Partitions and traverses through the individual address components.Stream
<? extends AddressComponent> stream()
Returns a sequential stream of the individual address components.static <T extends AddressComponent>
Stream<T> stream
(Function<T, Stream<? extends T>> addrStreamFunc, Collection<? extends T> components) Given a list of components, and a lambda that returns a stream for that component type, returns a sequential combined stream produced by applying that lambda to all the components.static <T extends AddressComponent>
Stream<T> Given a list of components, and a lambda that returns a stream for that component type, returns a combined stream produced by applying that lambda to all the components.Methods inherited from interface inet.ipaddr.format.AddressItem
compareTo, containsPrefixBlock, containsSinglePrefixBlock, getBitCount, getByteCount, getBytes, getBytes, getBytes, getCount, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isFullRange, isMax, isMultiple, isZero
-
Method Details
-
getLower
AddressComponent getLower()If this instance represents multiple address items, returns the one with the lowest numeric value.- Returns:
-
getUpper
AddressComponent getUpper()If this instance represents multiple address items, returns the one with the highest numeric value.- Returns:
-
getIterable
Iterable<? extends AddressComponent> getIterable()Useful for using an instance in a "for-each loop". Otherwise just calliterator()
directly.- Returns:
-
iterator
Iterator<? extends AddressComponent> iterator()Iterates through the individual address components.An address component can represent an individual segment, address, or section, or it can represent multiple, typically a subnet of addresses or a range of segment or section values.
Call
AddressItem.isMultiple()
to determine if this instance represents multiple, orAddressItem.getCount()
for the count.- Returns:
-
spliterator
AddressComponentRangeSpliterator<? extends AddressComponentRange,? extends AddressComponent> spliterator()Partitions and traverses through the individual address components.- Returns:
-
stream
Stream<? extends AddressComponent> stream()Returns a sequential stream of the individual address components. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Returns:
-
stream
@SafeVarargs static <T extends AddressComponent> Stream<T> stream(Function<T, Stream<? extends T>> addrStreamFunc, T... components) Given a list of components, and a lambda that returns a stream for that component type, returns a combined stream produced by applying that lambda to all the components.- Parameters:
addrStreamFunc
-components
-- Returns:
-
stream
static <T extends AddressComponent> Stream<T> stream(Function<T, Stream<? extends T>> addrStreamFunc, Collection<? extends T> components) Given a list of components, and a lambda that returns a stream for that component type, returns a sequential combined stream produced by applying that lambda to all the components. For a parallel stream, callBaseStream.parallel()
on the returned stream.- Parameters:
addrStreamFunc
-components
-- Returns:
-