|
||||||||||
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
net.sf.extjwnl.princeton.file.PrincetonChannelDictionaryFile
public class PrincetonChannelDictionaryFile
A RandomAccessDictionaryFile
that accesses files named with Princeton's dictionary file naming convention.
Uses java.nio.channels.FileChannel for file access.
Field Summary |
---|
Fields inherited from class net.sf.extjwnl.princeton.file.AbstractPrincetonRandomAccessDictionaryFile |
---|
encoding, ENCODING |
Fields inherited from class net.sf.extjwnl.dictionary.file.AbstractDictionaryFile |
---|
dictionary, file, params |
Constructor Summary | |
---|---|
PrincetonChannelDictionaryFile(Dictionary dictionary,
Map<String,Param> params)
|
|
PrincetonChannelDictionaryFile(Dictionary dictionary,
String path,
POS pos,
DictionaryFileType fileType,
Map<String,Param> params)
|
Method Summary | |
---|---|
void |
close()
Closes the file. |
long |
getFilePointer()
Returns the current position of the file pointer. |
boolean |
isOpen()
Returns true if the file is open. |
long |
length()
Returns the length, in bytes, of the file. |
PrincetonChannelDictionaryFile |
newInstance(Dictionary dictionary,
String path,
POS pos,
DictionaryFileType fileType)
Creates a new instance of the dictionary file. |
protected void |
openFile()
Opens the file. |
int |
read()
Reads a byte from the file. |
String |
readLine()
Reads a line from the file. |
String |
readLineWord()
Reads the first word from a file (ie offset, index word). |
void |
save()
Saves the file. |
void |
seek(long pos)
Goes to position pos in the file. |
Methods inherited from class net.sf.extjwnl.princeton.file.AbstractPrincetonRandomAccessDictionaryFile |
---|
edit, getNextLineOffset, getOffsetFormatString, isPreviousLineOffset, setNextLineOffset, writeLine, writeStrings |
Methods inherited from class net.sf.extjwnl.princeton.file.AbstractPrincetonDictionaryFile |
---|
getFilename |
Methods inherited from class net.sf.extjwnl.dictionary.file.AbstractDictionaryFile |
---|
delete, getDictionary, getFile, getFileType, getPOS, open, 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.DictionaryFile |
---|
delete, getFile, getFileType, getPOS, open |
Methods inherited from interface net.sf.extjwnl.util.factory.Owned |
---|
getDictionary, setDictionary |
Constructor Detail |
---|
public PrincetonChannelDictionaryFile(Dictionary dictionary, Map<String,Param> params)
public PrincetonChannelDictionaryFile(Dictionary dictionary, String path, POS pos, DictionaryFileType fileType, Map<String,Param> params)
Method Detail |
---|
public PrincetonChannelDictionaryFile newInstance(Dictionary dictionary, String path, POS pos, DictionaryFileType fileType)
DictionaryFileFactory
newInstance
in interface DictionaryFileFactory<PrincetonChannelDictionaryFile>
dictionary
- owner dictionarypath
- path to dictionary filespos
- part of speechfileType
- file type
public String readLine() throws IOException
RandomAccessDictionaryFile
readLine
in interface RandomAccessDictionaryFile
IOException
- IOExceptionpublic String readLineWord() throws IOException
RandomAccessDictionaryFile
readLineWord
in interface RandomAccessDictionaryFile
IOException
- IOExceptionpublic void seek(long pos) throws IOException
RandomAccessDictionaryFile
seek
in interface RandomAccessDictionaryFile
pos
- position pos in the file
IOException
- IOExceptionpublic long getFilePointer() throws IOException
RandomAccessDictionaryFile
getFilePointer
in interface RandomAccessDictionaryFile
IOException
- IOExceptionpublic boolean isOpen()
DictionaryFile
isOpen
in interface DictionaryFile
public void save()
DictionaryFile
save
in interface DictionaryFile
public void close()
DictionaryFile
close
in interface DictionaryFile
close
in class AbstractDictionaryFile
protected void openFile() throws IOException
AbstractDictionaryFile
openFile
in class AbstractDictionaryFile
IOException
- IOExceptionpublic long length() throws IOException
RandomAccessDictionaryFile
length
in interface RandomAccessDictionaryFile
IOException
- IOExceptionpublic int read() throws IOException
RandomAccessDictionaryFile
read
in interface RandomAccessDictionaryFile
IOException
- IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |