Class AbstractHashedMap.HashIterator<K,V>
java.lang.Object
org.apache.commons.collections4.map.AbstractHashedMap.HashIterator<K,V>
- Type Parameters:
K- the type of the keys in the mapV- the type of the values in the map
- Direct Known Subclasses:
AbstractHashedMap.EntrySetIterator,AbstractHashedMap.HashMapIterator,AbstractHashedMap.KeySetIterator,AbstractHashedMap.ValuesIterator
- Enclosing class:
AbstractHashedMap<K,V>
Base Iterator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe modification count expectedprivate intThe current index into the array of bucketsprivate AbstractHashedMap.HashEntry<K, V> The last returned entryprivate AbstractHashedMap.HashEntry<K, V> The next entryprivate final AbstractHashedMap<K, V> The parent map -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHashIterator(AbstractHashedMap<K, V> parent) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractHashedMap.HashEntry<K, V> Gets the current entry.booleanhasNext()Tests whether there is a next entry.protected AbstractHashedMap.HashEntry<K, V> Gets the next entry.voidremove()Removes the current element.toString()
-
Field Details
-
parent
The parent map -
hashIndex
private int hashIndexThe current index into the array of buckets -
last
The last returned entry -
next
The next entry -
expectedModCount
private int expectedModCountThe modification count expected
-
-
Constructor Details
-
HashIterator
Constructs a new instance.- Parameters:
parent- The parent AbstractHashedMap.
-
-
Method Details
-
currentEntry
Gets the current entry.- Returns:
- the current entry.
-
hasNext
public boolean hasNext()Tests whether there is a next entry.- Returns:
- whether there is a next entry.
-
nextEntry
Gets the next entry.- Returns:
- the next entry.
-
remove
public void remove()Removes the current element. -
toString
-