|
||||||||||
| 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(java.lang.String line)
|
protected abstract boolean |
needCreate()
|
void |
open(LineReader reader)
Open the reader |
protected java.lang.String |
readLine(java.io.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 java.io.IOException
position - current line positionoffset - current offset of line
java.io.IOException - if any problem while storing
protected abstract boolean needCreate()
throws java.io.IOException
true if the reader need to create his internal
datas.
java.io.IOException - if any problme while creating
public abstract long getOffset(long position)
throws java.io.IOException
position - position of the line
java.io.IOException - todo
public void open(LineReader reader)
throws java.io.IOException
reader - LineReader linked with this reader
java.io.IOException - if any problem while opening
public void close()
throws java.io.IOException
java.io.IOException - if any problem while closingpublic long getNbLines()
public void update(LineReader lineReader)
throws java.io.IOException
lineReader - lineReader linked with this reader
java.io.IOException - if any problem while updating
protected boolean isLogEntry(java.lang.String line)
throws java.io.IOException
java.io.IOException
protected java.lang.String readLine(java.io.BufferedReader reader)
throws java.io.IOException
reader - reader to use
java.io.IOException - if any problem while reading
protected long createOffsets(LineReader lineReader)
throws java.io.IOException
java.io.IOException
protected long createOffsetsForLog(LineReader lineReader)
throws java.io.IOException
java.io.IOException
protected long createOffsets(LineReader lineReader,
LineReader parent)
throws java.io.IOException
java.io.IOExceptionpublic void deleteOffsetFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||