class EnumeratorEnumerable<E> extends AbstractEnumerable<E>
Enumerable that encapsulates an enumerator.
This Enumerable supports only one enumerator, despite not
stating this. It is the responsibility of the user to call its
AbstractEnumerable.enumerator() only once.
Important: this class may not be final because
OnceEnumerable extends it.
OnceEnumerable| Constructor and Description |
|---|
EnumeratorEnumerable(Iterator<E> source)
Creates a
EnumeratorEnumerable instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearSource()
Clears the internal
source. |
protected Enumerator<E> |
getSource()
Gets the the internal
source. |
protected Enumerator<E> |
internalEnumerator()
Yields a new
Enumerator for the current Enumerable. |
protected boolean |
internalOnceOnly()
Gets whether the current instance may yield a
Enumerator
only once. |
enumerating, enumerator, onceOnlyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappend, as, asEnumeration, asFiltered, asSpliterator, asStream, asTolerant, asTolerant, cached, cached, choiceOf, choiceOf, concat, concatOn, distinct, elementsEqual, empty, filter, flatMap, iterate, iterator, limit, limitWhile, map, map, of, of, of, of, of, of, ofLateBinding, ofLazyEnumeration, ofLazyIterable, ofLazyIterator, ofLazySpliterator, ofLazyStream, on, onceOnly, peek, prepend, prependOn, range, rangeClosed, rangeInt, rangeIntClosed, rangeLong, rangeLongClosed, repeat, repeatAll, repeatEach, reverse, skip, skipWhile, sorted, sorted, take, takeWhile, union, unionOn, zipAll, zipAny, zipBoth, zipLeft, zipRightforEach, spliteratorpublic EnumeratorEnumerable(Iterator<E> source)
EnumeratorEnumerable instance.
The new EnumeratorEnumerable stores its source
internally.
source - Iterator providing the enumerated elements.protected boolean internalOnceOnly()
AbstractEnumerableEnumerator
only once.
This method is the internal counterpart of AbstractEnumerable.onceOnly().
internalOnceOnly in class AbstractEnumerable<E>AbstractEnumerable.enumerator() may be called
only once, false otherwise.protected Enumerator<E> internalEnumerator()
AbstractEnumerableEnumerator for the current Enumerable.
This method is the internal counterpart of AbstractEnumerable.enumerator().
internalEnumerator in class AbstractEnumerable<E>Enumerator instance.Enumerableprotected final Enumerator<E> getSource()
source.Enumerator source;protected final void clearSource()
source.Copyright © 2016. All rights reserved.