Module tech.bitey.bufferstuff
Package tech.bitey.bufferstuff
Class BufferSpliterators.IntBufferSpliterator
java.lang.Object
tech.bitey.bufferstuff.BufferSpliterators.IntBufferSpliterator
- All Implemented Interfaces:
Spliterator<Integer>,Spliterator.OfInt,Spliterator.OfPrimitive<Integer,IntConsumer, Spliterator.OfInt>
- Enclosing class:
- BufferSpliterators
public static final class BufferSpliterators.IntBufferSpliterator
extends Object
implements Spliterator.OfInt
A Spliterator.OfInt designed for use by sources that traverse and split
elements maintained in an unmodifiable
IntBuffer.
Based on Spliterators.IntArraySpliterator
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T extends Object,T_CONS extends Object, 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 -
Constructor Summary
ConstructorsConstructorDescriptionIntBufferSpliterator(IntBuffer buffer, int additionalCharacteristics) Creates a spliterator covering all of the givenIntBuffer.IntBufferSpliterator(IntBuffer buffer, int origin, int fence, int additionalCharacteristics) Creates a spliterator covering the givenIntBufferand range. -
Method Summary
Modifier and TypeMethodDescriptionintlongvoidforEachRemaining(IntConsumer action) Comparator<? super Integer>booleantryAdvance(IntConsumer action) trySplit()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Spliterator
getExactSizeIfKnown, hasCharacteristicsMethods inherited from interface java.util.Spliterator.OfInt
forEachRemaining, tryAdvance
-
Constructor Details
-
IntBufferSpliterator
Creates a spliterator covering all of the givenIntBuffer.- Parameters:
buffer- the buffer, assumed to be unmodified during useadditionalCharacteristics- Additional spliterator characteristics of this spliterator's source or elements beyondSIZEDandSUBSIZEDwhich are are always reported
-
IntBufferSpliterator
Creates a spliterator covering the givenIntBufferand range.- Parameters:
buffer- the buffer, assumed to be unmodified during useorigin- the least index (inclusive) to coverfence- one past the greatest index to coveradditionalCharacteristics- Additional spliterator characteristics of this spliterator's source or elements beyondSIZEDandSUBSIZEDwhich are are always reported
-
-
Method Details
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<Integer>- Specified by:
trySplitin interfaceSpliterator.OfInt- Specified by:
trySplitin interfaceSpliterator.OfPrimitive<Integer,IntConsumer, Spliterator.OfInt>
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceSpliterator.OfInt- Specified by:
forEachRemainingin interfaceSpliterator.OfPrimitive<Integer,IntConsumer, Spliterator.OfInt>
-
tryAdvance
- Specified by:
tryAdvancein interfaceSpliterator.OfInt- Specified by:
tryAdvancein interfaceSpliterator.OfPrimitive<Integer,IntConsumer, Spliterator.OfInt>
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<Integer>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<Integer>
-
getComparator
- Specified by:
getComparatorin interfaceSpliterator<Integer>
-