public class OneLinePerTemporalDocumentIterator extends Object implements Iterator<TemporalDocument>
TemporalDocument instances
given a file where each line of text is treated as a separate document.
This class is thread-safe.
| Constructor and Description |
|---|
OneLinePerTemporalDocumentIterator(String documentsFile)
Constructs an
Iterator for the documents contained in the
provided file. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns
true if there are more documents in the provided file. |
TemporalDocument |
next()
Returns the next document from the file.
|
void |
remove()
Throws an
UnsupportedOperationException if called. |
public OneLinePerTemporalDocumentIterator(String documentsFile) throws IOException
Iterator for the documents contained in the
provided file.documentsFile - a file that contains one document per lineIOException - if any error occurs when reading documentsFilepublic boolean hasNext()
true if there are more documents in the provided file.hasNext in interface Iterator<TemporalDocument>public TemporalDocument next()
next in interface Iterator<TemporalDocument>public void remove()
UnsupportedOperationException if called.remove in interface Iterator<TemporalDocument>Copyright © 2012. All Rights Reserved.