|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.ifremer.isisfish.logging.io.OffsetReader
public abstract class OffsetReader
Abstract implementation of OffsetReader giving generic
algorithms to extract offsets from a LineReader.
| Field Summary | |
|---|---|
protected long |
nbLines
number of lines managed by the reader |
| Constructor Summary | |
|---|---|
OffsetReader()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the reader |
protected long |
createOffsets(LineReader lineReader)
|
protected long |
createOffsets(LineReader lineReader,
LineReader parent)
|
protected long |
createOffsetsForLog(LineReader lineReader)
|
void |
deleteOffsetFile()
delete offset resources |
long |
getNbLines()
|
abstract long |
getOffset(long position)
Obtain an offset for a position |
protected boolean |
isLogEntry(String line)
|
protected abstract boolean |
needCreate()
|
void |
open(LineReader reader)
Open the reader |
protected String |
readLine(BufferedReader reader)
read a line from reader including terminaison caracters |
protected abstract void |
storeOffset(long position,
long offset)
Save the offset of the line for a given position |
void |
update(LineReader lineReader)
Update the reader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long nbLines
| Constructor Detail |
|---|
public OffsetReader()
| Method Detail |
|---|
protected abstract void storeOffset(long position,
long offset)
throws IOException
position - current line positionoffset - current offset of line
IOException - if any problem while storing
protected abstract boolean needCreate()
throws IOException
true if the reader need to create his internal
datas.
IOException - if any problme while creating
public abstract long getOffset(long position)
throws IOException
position - position of the line
IOException - todo
public void open(LineReader reader)
throws IOException
reader - LineReader linked with this reader
IOException - if any problem while opening
public void close()
throws IOException
IOException - if any problem while closingpublic long getNbLines()
public void update(LineReader lineReader)
throws IOException
lineReader - lineReader linked with this reader
IOException - if any problem while updating
protected boolean isLogEntry(String line)
throws IOException
IOException
protected String readLine(BufferedReader reader)
throws IOException
reader - reader to use
IOException - if any problem while reading
protected long createOffsets(LineReader lineReader)
throws IOException
IOException
protected long createOffsetsForLog(LineReader lineReader)
throws IOException
IOException
protected long createOffsets(LineReader lineReader,
LineReader parent)
throws IOException
IOExceptionpublic void deleteOffsetFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||