Module inet.ipaddr

Interface AddressComponentSpliterator<T extends AddressComponentRange>

Type Parameters:
T -
All Superinterfaces:
AddressComponentRangeSpliterator<T,T>, 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
  • Method Details

    • 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 return null. Upon non-null return, the sizes of the new spliterator and this spliterator as given by AddressComponentRangeSpliterator.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 interface AddressComponentRangeSpliterator<T extends AddressComponentRange,T extends AddressComponentRange>
      Specified by:
      trySplit in interface Spliterator<T extends AddressComponentRange>
      Returns:
      a Spliterator covering some portion of the elements, or null if this spliterator cannot be split