private final class SequencedHashMap.OrderedIterator extends Object implements Iterator
| Modifier and Type | Field and Description |
|---|---|
private long |
expectedModCount
Holds the expected modification count.
|
private SequencedHashMap.MapEntry |
pos
Holds the "current" position in the iterator.
|
private int |
returnType
Holds the type that should be returned from the iterator.
|
| Constructor and Description |
|---|
OrderedIterator(int returnType)
Construct an iterator over the sequenced elements in the order in
which they were added.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns whether there is any additional elements in the iterator to
be returned.
|
Object |
next()
Returns the next element from the iterator.
|
void |
remove()
Removes the last element returned from the
next() method
from the sequenced map. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprivate int returnType
private SequencedHashMap.MapEntry pos
private long expectedModCount
OrderedIterator(int returnType)
next() method returns the type
specified by returnType which must be either KEY,
VALUE, or ENTRY.returnType - The type (KEY,VALUE, ENTRY)public boolean hasNext()
public Object next()
next in interface IteratorNoSuchElementException - if there are no more elements in the iterator.ConcurrentModificationException - if a modification occurs in the underlying map.public void remove()
next() method
from the sequenced map.remove in interface IteratorIllegalStateException - if there isn't a "last element" to be removed. That is,
if next() has never been called, or if
remove() was already called on the element.ConcurrentModificationException - if a modification occurs in the underlying map.Copyright © 2003–2019 The Apache Software Foundation. All rights reserved.