Class RankedSequence.Itr

  • All Implemented Interfaces:
    java.util.Iterator<T>
    Enclosing class:
    RankedSequence<T>

    final class RankedSequence.Itr
    extends java.lang.Object
    implements java.util.Iterator<T>
    Custom Iterator that copes with modification by repositioning itself in the updated list.
    • Constructor Summary

      Constructors 
      Constructor Description
      Itr()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      boolean hasNext​(int rank)  
      T next()  
      int rank()  
      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

      • nextObj

        private T nextObj
      • nextUID

        private long nextUID
      • index

        private int index
    • Constructor Detail

      • Itr

        Itr()
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • hasNext

        public boolean hasNext​(int rank)
        Returns:
        true if the next element is ranked at or above the given rank; otherwise false
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • rank

        public int rank()
      • remove

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