|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFileSorter.BlockReader
private static class FileSorter.BlockReader
Reads a block of compressed lines from the temporary disk file, and feeds them out one at a time. Is Comparable (which compares the current line) so it can be used in a PriorityQueue.
Field Summary | |
---|---|
(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 Summary | |
---|---|
FileSorter.BlockReader(RandomAccessFile base,
long pos,
int memLimit)
Construct the reader |
Method Summary | |
---|---|
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
RandomAccessFile base
DataInput in
long pos
long memLimit
ArrayList buffer
int cur
boolean eof
Constructor Detail |
---|
public FileSorter.BlockReader(RandomAccessFile base, long pos, int memLimit) throws IOException
IOException
Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |