Package nom.tam.util

Class HashedList.HashedListIterator

java.lang.Object
nom.tam.util.HashedList.HashedListIterator
All Implemented Interfaces:
Iterator<VALUE>, Cursor<String,VALUE>
Enclosing class:
HashedList<VALUE extends CursorValue<String>>

private class HashedList.HashedListIterator extends Object implements Cursor<String,VALUE>
  • Field Details

    • current

      private int current
      This index points to the value that would be returned in the next 'next' call.
  • Constructor Details

    • HashedListIterator

      HashedListIterator(int start)
  • Method Details

    • add

      public void add(String key, VALUE ref)
      Description copied from interface: Cursor
      Add a keyed entry at the current location. The new entry is inserted before the entry that would be returned in the next invocation of 'next'. The new element is placed such that it will be called by a prev() call, but not a next() call.The return value for that call is unaffected. Note: this method is not in the Iterator interface.
      Specified by:
      add in interface Cursor<String,VALUE extends CursorValue<String>>
      Parameters:
      key - the key of the value to add
      ref - the value to add
    • add

      public void add(VALUE reference)
      Description copied from interface: Cursor
      Add an unkeyed element to the collection. The new element is placed such that it will be called by a prev() call, but not a next() call.
      Specified by:
      add in interface Cursor<String,VALUE extends CursorValue<String>>
      Parameters:
      reference - the value to add
    • end

      public VALUE end()
      Description copied from interface: Cursor
      move to the last element and return that.
      Specified by:
      end in interface Cursor<String,VALUE extends CursorValue<String>>
      Returns:
      the last element.
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<VALUE extends CursorValue<String>>
    • hasPrev

      public boolean hasPrev()
      Specified by:
      hasPrev in interface Cursor<String,VALUE extends CursorValue<String>>
      Returns:
      Is there a previous element in the collection?
    • next

      public VALUE next()
      Specified by:
      next in interface Iterator<VALUE extends CursorValue<String>>
    • next

      public VALUE next(int count)
      Description copied from interface: Cursor
      Returns the count next element in the iteration.
      Specified by:
      next in interface Cursor<String,VALUE extends CursorValue<String>>
      Parameters:
      count - the offset
      Returns:
      the n'th next element in the iteration
    • prev

      public VALUE prev()
      Specified by:
      prev in interface Cursor<String,VALUE extends CursorValue<String>>
      Returns:
      the previous element.
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<VALUE extends CursorValue<String>>
    • setKey

      public void setKey(String key)
      Description copied from interface: Cursor
      Point the iterator to a particular keyed entry. Point to the end of the list if the key is not found.This method is not in the Iterator interface.
      Specified by:
      setKey in interface Cursor<String,VALUE extends CursorValue<String>>
      Parameters:
      key - the key to search for