E - Type of elements being enumerated.abstract class AbstractEnumerator<E> extends Object implements Enumerator<E>
Enumerator interface.
This class forms the basis for all the concrete implementations of
Enumerator within the enumj package.
AbstractEnumerable,
Enumerable,
Enumerator| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEnumerator()
Constructs a new
AbstractEnumerator instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup()
Cleans up the internals of the current enumerator when enumeration
ends.
|
boolean |
enumerating()
Returns whether the enumerator has started enumerating.
|
boolean |
hasNext() |
protected abstract boolean |
internalHasNext()
Returns whether the enumerator has more elements.
|
protected abstract E |
internalNext()
Returns the next enumerated element.
|
E |
next() |
clone, 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, removeprotected AbstractEnumerator()
AbstractEnumerator instance.
The new AbstractEnumerable instance gets initialised as
non-enumerating.
enumerating()public final boolean enumerating()
Enumerator
This method returns false before the first call
to hasNext and true afterwards.
enumerating in interface Enumerator<E>Iterator.hasNext(),
Iterator.next()protected abstract boolean internalHasNext()
This method is the internal counterpart of hasNext().
next()protected abstract E internalNext()
This method is the internal counterpart of hasNext()
protected void cleanup()
By default this method does nothing.
hasNext(),
next(),
internalHasNext(),
internalNext()Copyright © 2016. All rights reserved.