|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.extjwnl.dictionary.file.AbstractDictionaryFile
net.sf.extjwnl.princeton.file.AbstractPrincetonDictionaryFile
net.sf.extjwnl.princeton.file.AbstractPrincetonRandomAccessDictionaryFile
public abstract class AbstractPrincetonRandomAccessDictionaryFile
Base class for random access files.
Field Summary | |
---|---|
protected String |
encoding
|
static String |
ENCODING
Dictionary file encoding. |
Fields inherited from class net.sf.extjwnl.dictionary.file.AbstractDictionaryFile |
---|
dictionary, file, params |
Constructor Summary | |
---|---|
protected |
AbstractPrincetonRandomAccessDictionaryFile(Dictionary dictionary,
Map<String,Param> params)
|
protected |
AbstractPrincetonRandomAccessDictionaryFile(Dictionary dictionary,
String path,
POS pos,
DictionaryFileType fileType,
Map<String,Param> params)
|
Method Summary | |
---|---|
void |
edit()
Reopens file in write mode. |
long |
getNextLineOffset()
Returns the byte offset of the next line (after the position of the file pointer). |
String |
getOffsetFormatString()
Returns offset format string that accommodates largest offset. |
boolean |
isPreviousLineOffset(long offset)
Returns true if offset is the previous offset. |
void |
setNextLineOffset(long previousOffset,
long nextOffset)
Moves the file pointer so that its next line offset is nextOffset. |
void |
writeLine(String line)
Writes a line to the file. |
void |
writeStrings(Collection<String> strings)
Writes strings in file. |
Methods inherited from class net.sf.extjwnl.princeton.file.AbstractPrincetonDictionaryFile |
---|
getFilename |
Methods inherited from class net.sf.extjwnl.dictionary.file.AbstractDictionaryFile |
---|
close, delete, getDictionary, getFile, getFileType, getPOS, open, openFile, setDictionary |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.extjwnl.dictionary.file.RandomAccessDictionaryFile |
---|
getFilePointer, length, read, readLine, readLineWord, seek |
Methods inherited from interface net.sf.extjwnl.dictionary.file.DictionaryFile |
---|
close, delete, getFile, getFileType, getPOS, isOpen, open, save |
Methods inherited from interface net.sf.extjwnl.util.factory.Owned |
---|
getDictionary, setDictionary |
Field Detail |
---|
public static final String ENCODING
Charset
.
protected String encoding
Constructor Detail |
---|
protected AbstractPrincetonRandomAccessDictionaryFile(Dictionary dictionary, Map<String,Param> params)
protected AbstractPrincetonRandomAccessDictionaryFile(Dictionary dictionary, String path, POS pos, DictionaryFileType fileType, Map<String,Param> params)
Method Detail |
---|
public void setNextLineOffset(long previousOffset, long nextOffset)
RandomAccessDictionaryFile
setNextLineOffset
in interface RandomAccessDictionaryFile
previousOffset
- previous offsetnextOffset
- next offsetpublic boolean isPreviousLineOffset(long offset)
RandomAccessDictionaryFile
isPreviousLineOffset
in interface RandomAccessDictionaryFile
offset
- previous offset
public long getNextLineOffset()
RandomAccessDictionaryFile
getNextLineOffset
in interface RandomAccessDictionaryFile
public void edit() throws IOException
DictionaryFile
edit
in interface DictionaryFile
IOException
- IOExceptionpublic void writeStrings(Collection<String> strings) throws IOException
RandomAccessDictionaryFile
writeStrings
in interface RandomAccessDictionaryFile
strings
- strings to write
IOException
- IOExceptionpublic String getOffsetFormatString()
RandomAccessDictionaryFile
getOffsetFormatString
in interface RandomAccessDictionaryFile
public void writeLine(String line) throws IOException
RandomAccessDictionaryFile
writeLine
in interface RandomAccessDictionaryFile
line
- a line to write
IOException
- IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |