@Mutable public class PruningIterator<ELEMENT> extends SingleIteratorBasedIterator<ELEMENT,ELEMENT>
Integer.MAX_VALUE, this iterator returns values as long as the given iterator does, which is important for skipping infinite iterables.| Modifier and Type | Field and Description |
|---|---|
protected @Positive int |
endIndex |
protected @NonNegative int |
startIndex |
primaryIterator| Modifier | Constructor and Description |
|---|---|
protected |
PruningIterator(@Nonnull Iterator<? extends ELEMENT> primaryIterator,
@NonNegative int startIndex,
@Positive int endIndex) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
ELEMENT |
next() |
static <ELEMENT> @Nonnull PruningIterator<ELEMENT> |
with(@Nonnull Iterator<? extends ELEMENT> iterator,
@NonNegative int startIndex,
@Positive int endIndex)
Returns a new pruning iterator that iterates over the elements of the given iterator from the given start index to but not including the given end index.
|
removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining@NonNegative protected final @NonNegative int startIndex
@Positive protected final @Positive int endIndex
@Pure @Capturable @Nonnull public static <ELEMENT> @Nonnull PruningIterator<ELEMENT> with(@Captured @Nonnull @Nonnull Iterator<? extends ELEMENT> iterator, @NonNegative @NonNegative int startIndex, @Positive @Positive int endIndex)
@Pure public boolean hasNext()
Copyright © 2017. All rights reserved.