Class SkipIterator<T>

  • All Implemented Interfaces:

    public class SkipIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    • Constructor Summary

      Constructor Description
      SkipIterator​(java.util.Iterator<T> iterator)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> SkipIterator<T> create​(java.util.Iterator<T> iterator)  
      long getPosition()  
      boolean hasNext()  
      T next()  
      void remove()  
      long skip​(long skipNum)
      Attempts to skip a number of elements
      • Methods inherited from class java.lang.Object

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

    • Constructor Detail

      • SkipIterator

        public SkipIterator​(java.util.Iterator<T> iterator)
    • Method Detail

      • create

        public static <T> SkipIterator<T> create​(java.util.Iterator<T> iterator)
      • skip

        public long skip​(long skipNum)
        Attempts to skip a number of elements
        skipNum - number of elements to skip
        long value with the number of elements that were actually skipped
      • getPosition

        public long getPosition()
      • hasNext

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

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

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