Documentation of 'gnu.trove.impl.hash.THashIterator' Java class
THashIterator
gnu.trove.impl.hash

Class THashIterator<V>

  • All Implemented Interfaces:
    TIterator, java.util.Iterator<V>
    Direct Known Subclasses:
    TObjectHashIterator


    public abstract class THashIterator<V>
    extends java.lang.Object
    implements TIterator, java.util.Iterator<V>
    Implements all iterator functions for the hashed object set. Subclasses may override objectAtIndex to vary the object returned by calls to next() (e.g. for values, and Map.Entry objects).

    Note that iteration is fastest if you forego the calls to hasNext in favor of checking the size of the structure yourself and then call next() that many times:

     Iterator i = collection.iterator();
     for (int size = collection.size(); size-- > 0;) {
       Object o = i.next();
     }
     

    You may, of course, use the hasNext(), next() idiom too if you aren't in a performance critical spot.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean hasNext()
      Returns true if the iterator can be advanced past its current location.
      V next()
      Moves the iterator to the next Object and returns it.
      void remove()
      Removes the last entry returned by the iterator.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Method Detail

      • next

        public V next()
        Moves the iterator to the next Object and returns it.
        Specified by:
        next in interface java.util.Iterator<V>
        Returns:
        an Object value
        Throws:
        java.util.ConcurrentModificationException - if the structure was changed using a method that isn't on this iterator.
        java.util.NoSuchElementException - if this is called on an exhausted iterator.
      • hasNext

        public boolean hasNext()
        Returns true if the iterator can be advanced past its current location.
        Specified by:
        hasNext in interface TIterator
        Specified by:
        hasNext in interface java.util.Iterator<V>
        Returns:
        a boolean value
      • remove

        public void remove()
        Removes the last entry returned by the iterator. Invoking this method more than once for a single entry will leave the underlying data structure in a confused state.
        Specified by:
        remove in interface TIterator
        Specified by:
        remove in interface java.util.Iterator<V>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.