public class IteratorCollection
extends java.util.AbstractCollection
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(java.util.Iterator iterator) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Iterator |
iterator() |
int |
size() |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in class java.util.AbstractCollectionpublic int size()
size in interface java.util.Collectionsize in class java.util.AbstractCollection