private static class FileSorter.BlockReader
extends Object
implements Comparable
Modifier and Type | Field and Description |
---|---|
(package private) RandomAccessFile |
base
The temporary file being read
|
(package private) ArrayList |
buffer
Buffer of lines
|
(package private) int |
cur
Position within buffer
|
(package private) boolean |
eof
Set to true when last line has been read
|
(package private) DataInput |
in
Input source that decompresses and reads UTF strings
|
(package private) long |
memLimit
Memory limit for this particular reader
|
(package private) long |
pos
Current position within the random access file
|
Constructor and Description |
---|
BlockReader(RandomAccessFile base,
long pos,
int memLimit)
Construct the reader
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object other)
Compare the current line of this reader with that of another.
|
String |
cur()
Obtain the current line of the file.
|
private boolean |
fill()
Fill the buffer with more lines.
|
boolean |
next()
Advance to the next line.
|
RandomAccessFile base
DataInput in
long pos
long memLimit
ArrayList buffer
int cur
boolean eof
public BlockReader(RandomAccessFile base, long pos, int memLimit) throws IOException
IOException
public boolean next() throws IOException
cur()
.IOException
public String cur()
next()
returned true.public int compareTo(Object other)
compareTo
in interface Comparable
private boolean fill() throws IOException
IOException