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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in class java.util.AbstractCollection
public int size()
size
in interface java.util.Collection
size
in class java.util.AbstractCollection