Class DoublyIndexedTable.TableIterator

  • All Implemented Interfaces:
    java.util.Iterator
    Enclosing class:
    DoublyIndexedTable

    protected class DoublyIndexedTable.TableIterator
    extends java.lang.Object
    implements java.util.Iterator
    An Iterator class for a DoublyIndexedTable.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean finished
      Whether the Iterator has run out of elements.
      private DoublyIndexedTable.Entry nextEntry
      The next Entry to return.
      private int nextIndex
      The index of the next entry to return.
    • Constructor Summary

      Constructors 
      Constructor Description
      TableIterator()
      Creates a new TableIterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void findNext()
      Searches for the next Entry in the table.
      boolean hasNext()  
      java.lang.Object next()  
      void remove()  
      • Methods inherited from class java.lang.Object

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

        forEachRemaining
    • Field Detail

      • nextIndex

        private int nextIndex
        The index of the next entry to return.
      • finished

        private boolean finished
        Whether the Iterator has run out of elements.
    • Constructor Detail

      • TableIterator

        public TableIterator()
        Creates a new TableIterator.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator
      • next

        public java.lang.Object next()
        Specified by:
        next in interface java.util.Iterator
      • findNext

        protected void findNext()
        Searches for the next Entry in the table.
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator