Class ObjectListIterator<E>
java.lang.Object
com.globalmentor.collections.iterators.ObjectIterator<E>
com.globalmentor.collections.iterators.ObjectListIterator<E>
- Type Parameters:
E
- The type of elements in this iterator
- All Implemented Interfaces:
Iterable<E>
,Iterator<E>
,ListIterator<E>
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.- Author:
- Garret Wilson
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Whether we've not retrieved the object. -
Constructor Summary
-
Method Summary
Methods inherited from class com.globalmentor.collections.iterators.ObjectIterator
iterator, remove
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
Methods inherited from interface java.util.ListIterator
remove
-
Field Details
-
hasNext
protected boolean hasNextWhether we've not retrieved the object.
-
-
Constructor Details
-
ObjectListIterator
Object constructor.- Parameters:
object
- The single object over which iteration should occur.
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from class:ObjectIterator
- Specified by:
hasNext
in interfaceIterator<E>
- Specified by:
hasNext
in interfaceListIterator<E>
- Overrides:
hasNext
in classObjectIterator<E>
- Returns:
true
if the single object has not yet been retrieved.
-
next
- Specified by:
next
in interfaceIterator<E>
- Specified by:
next
in interfaceListIterator<E>
- Overrides:
next
in classObjectIterator<E>
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceListIterator<E>
-
previous
- Specified by:
previous
in interfaceListIterator<E>
-
nextIndex
public int nextIndex()- Specified by:
nextIndex
in interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndex
in interfaceListIterator<E>
-
set
This implementation does not support setting the element.- Specified by:
set
in interfaceListIterator<E>
-
add
This implementation does not support adding an element.- Specified by:
add
in interfaceListIterator<E>
-