Interface AddressComponentSpliterator<T extends AddressComponentRange>
- Type Parameters:
T
-
- All Superinterfaces:
AddressComponentRangeSpliterator<T,
,T> Spliterator<T>
- Author:
- seancfoley
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,
T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Method Summary
Modifier and TypeMethodDescriptiontrySplit()
If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.Methods inherited from interface inet.ipaddr.format.util.AddressComponentRangeSpliterator
getAddressItem, getComparator, getSize
Methods inherited from interface java.util.Spliterator
characteristics, estimateSize, forEachRemaining, getExactSizeIfKnown, hasCharacteristics, tryAdvance
-
Method Details
-
trySplit
AddressComponentSpliterator<T> trySplit()Description copied from interface:AddressComponentRangeSpliterator
If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.The returned Spliterator will cover a strict prefix of the elements, preserving the ordering of the address items.
Repeated calls to
trySplit()
will eventually returnnull
. Upon non-null return, the sizes of the new spliterator and this spliterator as given byAddressComponentRangeSpliterator.getSize()
will add up to the size of this spliterator before splitting.The remaining elements of segment spliterators will be divided exactly in half.
Other address item spliterators divide the original address item roughly in half, not the remaining elements. Because the original address item is divided instead of dividing the remaining elements, the resulting spliterators will not be roughly equal in size if a disproportionate amount of traversing using
Spliterator.tryAdvance(java.util.function.Consumer)
occurred before splitting. In fact, the splitting will not happen at all if half the elements have already been traversed.- Specified by:
trySplit
in interfaceAddressComponentRangeSpliterator<T extends AddressComponentRange,
T extends AddressComponentRange> - Specified by:
trySplit
in interfaceSpliterator<T extends AddressComponentRange>
- Returns:
- a
Spliterator
covering some portion of the elements, ornull
if this spliterator cannot be split
-