Interface AddressComponentSpliterator<T extends AddressComponentRange>
-
- Type Parameters:
T
-
- All Superinterfaces:
AddressComponentRangeSpliterator<T,T>
,java.util.Spliterator<T>
public interface AddressComponentSpliterator<T extends AddressComponentRange> extends AddressComponentRangeSpliterator<T,T>
AddressComponentSpliterator is an AddressComponentRangeSpliterator for address components where the type of the item producing the spliterator matches the type of the item traversed.- Author:
- seancfoley
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.Spliterator
java.util.Spliterator.OfDouble, java.util.Spliterator.OfInt, java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive<T extends java.lang.Object,T_CONS extends java.lang.Object,T_SPLITR extends java.util.Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AddressComponentSpliterator<T>
trySplit()
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
-
-
-
-
Method Detail
-
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 interfacejava.util.Spliterator<T extends AddressComponentRange>
- Returns:
- a
Spliterator
covering some portion of the elements, ornull
if this spliterator cannot be split
-
-