comirva.util
Class FileUtils.TextFileIterator

java.lang.Object
  extended by 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)


Constructor Summary
FileUtils.TextFileIterator(File textFile)
           
 
Method Summary
 boolean hasNext()
           
 Iterator<String> iterator()
           
 String next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils.TextFileIterator

public FileUtils.TextFileIterator(File textFile)
Method Detail

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>