public class LineIterator extends it.unimi.dsi.fastutil.objects.AbstractObjectIterator<MutableString>
hasNext()
should return true, the last line read
from the underlying fast buffered reader has to be cached.
Mixing calls to this adapter and to the underlying fast buffered
reader will not usually give the expected results.
This class reuses the same mutable strings. As a result,
the comments for FileLinesCollection
apply here. If you want just get all the lines, use allLines()
.
Constructor and Description |
---|
LineIterator(FastBufferedReader fastBufferedReader)
Creates a new line iterator over a specified fast buffered reader.
|
LineIterator(FastBufferedReader fastBufferedReader,
ProgressLogger pl)
Creates a new line iterator over a specified fast buffered reader.
|
Modifier and Type | Method and Description |
---|---|
List<MutableString> |
allLines()
Returns all lines remaining in this iterator as a list.
|
boolean |
hasNext() |
MutableString |
next() |
public LineIterator(FastBufferedReader fastBufferedReader, ProgressLogger pl)
fastBufferedReader
- the underlying buffered reader.pl
- an optional progress logger, or null
.public LineIterator(FastBufferedReader fastBufferedReader)
fastBufferedReader
- the underlying buffered reader.public boolean hasNext()
public MutableString next()
public List<MutableString> allLines()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.