E - Type of enumerated elements.final class ChoiceEnumerator<E> extends AbstractEnumerator<E>
Enumerator implementation that enumerates by choosing among the
elements of given source Iterator instances.| Constructor and Description |
|---|
ChoiceEnumerator(IntSupplier indexSupplier,
IntUnaryOperator nextIndexSupplier,
Iterator<E> first,
Iterator<E> second,
List<Iterator<E>> rest)
Constructs a
ChoiceEnumerator instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup()
Cleans up the internals of the current enumerator when enumeration
ends.
|
protected boolean |
internalHasNext()
Returns whether the enumerator has more elements.
|
protected E |
internalNext()
Returns the next enumerated element.
|
enumerating, hasNext, nextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallMatch, anyMatch, append, as, asEnumerable, asEnumeration, asFiltered, asOptional, asShareable, asSpliterator, asStream, asSupplier, asTolerant, asTolerant, choiceOf, choiceOf, collect, concat, concat, concat, concat, concat, concat, concatOn, contains, count, distinct, elementAt, elementsEqual, empty, filter, first, flatMap, forEach, iterate, last, limit, limitWhile, map, map, max, min, noneMatch, of, of, of, of, of, of, of, ofLateBinding, ofLazyEnumeration, ofLazyIterable, ofLazyIterator, ofLazySpliterator, ofLazyStream, on, peek, prepend, prepend, prepend, prepend, prepend, prepend, prependOn, range, rangeClosed, rangeInt, rangeIntClosed, rangeLong, rangeLongClosed, reduce, reduce, repeat, repeatAll, repeatAll, repeatEach, reverse, single, skip, skipWhile, sorted, sorted, take, takeWhile, toArray, toList, toMap, toSet, union, union, union, union, union, union, unionOn, zipAll, zipAny, zipBoth, zipLeft, zipRightforEachRemaining, removepublic ChoiceEnumerator(IntSupplier indexSupplier, IntUnaryOperator nextIndexSupplier, Iterator<E> first, Iterator<E> second, List<Iterator<E>> rest)
ChoiceEnumerator instance.indexSupplier - IntSupplier instance that yields the index
of the source Iterator instance to get the next element from.nextIndexSupplier - IntSupplier instance that yields the
subsequent indexes of the source Iterator instance to get the
next element from, if the source indicated by indexSupplier runs
out of elements.first - first Iterator source to choose elements from.second - second Iterator source to choose elements from.rest - rest of Iterator sources to choose elements from.protected boolean internalHasNext()
AbstractEnumerator
This method is the internal counterpart of AbstractEnumerator.hasNext().
internalHasNext in class AbstractEnumerator<E>AbstractEnumerator.next()protected E internalNext()
AbstractEnumerator
This method is the internal counterpart of AbstractEnumerator.hasNext()
internalNext in class AbstractEnumerator<E>protected void cleanup()
AbstractEnumeratorBy default this method does nothing.
cleanup in class AbstractEnumerator<E>AbstractEnumerator.hasNext(),
AbstractEnumerator.next(),
AbstractEnumerator.internalHasNext(),
AbstractEnumerator.internalNext()Copyright © 2016. All rights reserved.