T - The element type of the iterator and the collectionpublic class IteratorCollection<T> extends AbstractCollection<T>
Collection that lazily reads its elements from an Iterator.
In other words, you can call iterator() as often as you want, but the IteratorCollection will
iterate over its delegate only once.
| Constructor and Description |
|---|
IteratorCollection(Iterator<T> iterator) |
| Modifier and Type | Method and Description |
|---|---|
Iterator<T> |
iterator() |
int |
size() |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic Iterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>iterator in class AbstractCollection<T>public int size()
size in interface Collection<T>size in class AbstractCollection<T>Copyright © 2019. All rights reserved.