Class IteratorAsSpliterator.Builder<T>

java.lang.Object
org.infinispan.stream.impl.spliterators.IteratorAsSpliterator.Builder<T>
All Implemented Interfaces:
Supplier<IteratorAsSpliterator<T>>
Enclosing class:
IteratorAsSpliterator<T>

public static class IteratorAsSpliterator.Builder<T> extends Object implements Supplier<IteratorAsSpliterator<T>>
  • Constructor Details

    • Builder

      public Builder(Iterator<? extends T> iterator)
    • Builder

      public Builder(org.infinispan.commons.util.CloseableIterator<? extends T> closeableIterator)
  • Method Details

    • setCharacteristics

      public IteratorAsSpliterator.Builder<T> setCharacteristics(int characteristics)
      Sets the characteristics the subsequent spliterator will have.
      Parameters:
      characteristics -
      Returns:
    • setBatchIncrease

      public IteratorAsSpliterator.Builder<T> setBatchIncrease(int batchIncrease)
      Sets the batch increase size. This controls how much larger subsequent splits are. The default value is 1024;
      Parameters:
      batchIncrease -
      Returns:
      this
    • setMaxBatchSize

      public IteratorAsSpliterator.Builder setMaxBatchSize(int maxBatchSize)
      Sets the max batch size for a thread to use - This defaults to 51200
      Parameters:
      maxBatchSize -
      Returns:
      this
    • setEstimateRemaining

      public IteratorAsSpliterator.Builder<T> setEstimateRemaining(long estimateRemaining)
      Sets how many estimated elements are remaining for this iterator This defaults to Long.MAX_VALUE. It is heavily recommended to provide an exact or estimate value to help with controlling parallelism
      Parameters:
      estimateRemaining -
      Returns:
      this
    • get

      public IteratorAsSpliterator<T> get()
      Specified by:
      get in interface Supplier<T>