Class Heap.UnorderedIter

  • All Implemented Interfaces:
    Iter
    Enclosing class:
    Heap<E>

    public class Heap.UnorderedIter
    extends java.lang.Object
    implements Iter
    Heap iterator.
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int pos
      Current iterator position.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected UnorderedIter()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Heap.UnorderedIter advance()
      Moves the iterator forward to the next entry.
      E get()
      Get the current queue element.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pos

        int pos
        Current iterator position.
    • Constructor Detail

      • UnorderedIter

        protected UnorderedIter()
        Constructor.
    • Method Detail

      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public Heap.UnorderedIter advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.
      • get

        public E get()
        Get the current queue element.
        Returns:
        Element