Class FileLineIterator

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Iterator<String>

    public class FileLineIterator
    extends org.apache.commons.io.LineIterator
    This Iterator's items are lines of a file. The hasNext() method returns true if the file contains anymore lines, false otherwise. The next() method returns the next line in the file. Once all lines have been iterated through and hasNext() returns false the underlying file is deleted.
    Author:
    Erik Paulsson Date: 5/2/14
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<String>
        Overrides:
        hasNext in class org.apache.commons.io.LineIterator
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Overrides:
        close in class org.apache.commons.io.LineIterator