Class ObjectIterator<E>
java.lang.Object
com.globalmentor.collections.iterators.ObjectIterator<E>
- Type Parameters:
E
- The type of elements in this iterator
- Direct Known Subclasses:
ObjectListIterator
An iterable and iterator to a single object. This implementation allows
null
values. This implementation does not allow removal, as removing has
no meaning in this context. This version releases the object when iteration has occurred (i.e. when hasNext()
would return false
).- Author:
- Garret Wilson
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
object
The single object being iterated. -
hasNext
protected boolean hasNextWhether we've not retrieved the object.
-
-
Constructor Details
-
ObjectIterator
Object constructor.- Parameters:
object
- The single object over which iteration should occur.
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()This implementation does not support removal. -
iterator
This implementation returnsthis
.
-