comirva.util
Class FileUtils.TextFileIterator
java.lang.Object
comirva.util.FileUtils.TextFileIterator
- All Implemented Interfaces:
- Iterable<String>, Iterator<String>
- Enclosing class:
- FileUtils
public static class FileUtils.TextFileIterator
- extends Object
- implements Iterator<String>, Iterable<String>
Iterates over the lines of a text file without storing the whole
contents of the text file in RAM (only one line at a time is kept
in RAM, except for object reference / garbage collection issues)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtils.TextFileIterator
public FileUtils.TextFileIterator(File textFile)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<String>
next
public String next()
- Specified by:
next
in interface Iterator<String>
remove
public void remove()
- Specified by:
remove
in interface Iterator<String>
iterator
public Iterator<String> iterator()
- Specified by:
iterator
in interface Iterable<String>