Class AbstractLinkedMap.LinkIterator<K,V>
- java.lang.Object
-
- org.apache.commons.collections4.map.AbstractLinkedMap.LinkIterator<K,V>
-
- Type Parameters:
K- the key type.V- the value type.
- Direct Known Subclasses:
AbstractLinkedMap.EntrySetIterator,AbstractLinkedMap.KeySetIterator,AbstractLinkedMap.LinkMapIterator,AbstractLinkedMap.ValuesIterator
- Enclosing class:
- AbstractLinkedMap<K,V>
protected abstract static class AbstractLinkedMap.LinkIterator<K,V> extends java.lang.Object
Base Iterator that iterates in link order.
-
-
Field Summary
Fields Modifier and Type Field Description protected intexpectedModCountThe modification count expectedprotected AbstractLinkedMap.LinkEntry<K,V>lastThe current (last returned) entryprotected AbstractLinkedMap.LinkEntry<K,V>nextThe next entryprotected AbstractLinkedMap<K,V>parentThe parent map
-
Constructor Summary
Constructors Modifier Constructor Description protectedLinkIterator(AbstractLinkedMap<K,V> parent)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractLinkedMap.LinkEntry<K,V>currentEntry()Gets the current entry.booleanhasNext()Tests whether there is another entry.booleanhasPrevious()Tests whether there is a previous entry.protected AbstractLinkedMap.LinkEntry<K,V>nextEntry()Gets the next entry.protected AbstractLinkedMap.LinkEntry<K,V>previousEntry()Gets the previous entry.voidremove()Removes the current entry.voidreset()Resets the state to the end.java.lang.StringtoString()
-
-
-
Field Detail
-
parent
protected final AbstractLinkedMap<K,V> parent
The parent map
-
last
protected AbstractLinkedMap.LinkEntry<K,V> last
The current (last returned) entry
-
next
protected AbstractLinkedMap.LinkEntry<K,V> next
The next entry
-
expectedModCount
protected int expectedModCount
The modification count expected
-
-
Constructor Detail
-
LinkIterator
protected LinkIterator(AbstractLinkedMap<K,V> parent)
Constructs a new instance.- Parameters:
parent- The parent AbstractLinkedMap.
-
-
Method Detail
-
currentEntry
protected AbstractLinkedMap.LinkEntry<K,V> currentEntry()
Gets the current entry.- Returns:
- the current entry.
-
hasNext
public boolean hasNext()
Tests whether there is another entry.- Returns:
- whether there is another entry.
-
hasPrevious
public boolean hasPrevious()
Tests whether there is a previous entry.- Returns:
- whether there is a previous entry.
-
nextEntry
protected AbstractLinkedMap.LinkEntry<K,V> nextEntry()
Gets the next entry.- Returns:
- the next entry.
-
previousEntry
protected AbstractLinkedMap.LinkEntry<K,V> previousEntry()
Gets the previous entry.- Returns:
- the previous entry.
-
remove
public void remove()
Removes the current entry.
-
reset
public void reset()
Resets the state to the end.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-