Class Object2ObjectHashMap.EntryIterator

java.lang.Object
org.agrona.collections.Object2ObjectHashMap.EntryIterator
All Implemented Interfaces:
Iterator<Map.Entry<K,V>>, Map.Entry<K,V>
Enclosing class:
Object2ObjectHashMap<K,V>

public final class Object2ObjectHashMap.EntryIterator extends Object implements Iterator<Map.Entry<K,V>>, Map.Entry<K,V>
An iterator over entries.
  • Field Details

    • isPositionValid

      protected boolean isPositionValid
      Is position valid.
  • Constructor Details

    • EntryIterator

      public EntryIterator()
      Create a new instance.
  • Method Details

    • getKey

      public K getKey()
      Specified by:
      getKey in interface Map.Entry<K,V>
    • getValue

      public V getValue()
      Specified by:
      getValue in interface Map.Entry<K,V>
    • setValue

      public V setValue(V value)
      Specified by:
      setValue in interface Map.Entry<K,V>
    • next

      public Map.Entry<K,V> next()
      Specified by:
      next in interface Iterator<Map.Entry<K,V>>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map.Entry<K,V>
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map.Entry<K,V>
      Overrides:
      equals in class Object
    • remaining

      public int remaining()
      Return number of remaining elements.
      Returns:
      number of remaining elements.
    • hasNext

      public boolean hasNext()
      Check if there is next element to iterate.
      Returns:
      true if remaining > 0.
    • findNext

      protected final void findNext()
      Find next element.
      Throws:
      NoSuchElementException - if no more elements.
    • remove

      public void remove()
      Removes from the underlying collection the last element returned by this iterator.