Package net.didion.jwnl.princeton.file
Class PrincetonChannelDictionaryFile
java.lang.Object
net.didion.jwnl.dictionary.file.AbstractDictionaryFile
net.didion.jwnl.princeton.file.AbstractPrincetonDictionaryFile
net.didion.jwnl.princeton.file.AbstractPrincetonRandomAccessDictionaryFile
net.didion.jwnl.princeton.file.PrincetonChannelDictionaryFile
- All Implemented Interfaces:
DictionaryFile,RandomAccessDictionaryFile
A
RandomAccessDictionaryFile that accesses files named with Princeton's dictionary file naming convention.
Uses java.nio.channels.FileChannel for file access.-
Field Summary
FieldsFields inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
COMMENT_HEADER -
Constructor Summary
ConstructorsConstructorDescriptionPrincetonChannelDictionaryFile(String path, POS pos, DictionaryFileType fileType) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the filelongGet the current position of the file pointer.booleanisOpen()Return true if the file is openlonglength()Get the length, in bytes, of the filenewInstance(String path, POS pos, DictionaryFileType fileType) Create a new instance of the dictionary fileprotected voidOpen the file at pathpathintread()Read a byte from the filereadLine()Read a line from the filevoidseek(long pos) Go to postion pos in the file.Methods inherited from class net.didion.jwnl.princeton.file.AbstractPrincetonRandomAccessDictionaryFile
getNextLineOffset, isPreviousLineOffset, setNextLineOffsetMethods inherited from class net.didion.jwnl.princeton.file.AbstractPrincetonDictionaryFile
makeFilenameMethods inherited from class net.didion.jwnl.dictionary.file.AbstractDictionaryFile
getFile, getFileType, getPOS, openMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
getFile, getFileType, getPOS, open
-
Field Details
-
_buffer
The random-access file. -
_channel
-
-
Constructor Details
-
PrincetonChannelDictionaryFile
public PrincetonChannelDictionaryFile() -
PrincetonChannelDictionaryFile
-
-
Method Details
-
newInstance
Description copied from interface:DictionaryFileCreate a new instance of the dictionary file -
readLine
Description copied from interface:RandomAccessDictionaryFileRead a line from the file- Throws:
IOException
-
seek
Description copied from interface:RandomAccessDictionaryFileGo to postion pos in the file.- Throws:
IOException
-
getFilePointer
Description copied from interface:RandomAccessDictionaryFileGet the current position of the file pointer.- Throws:
IOException
-
isOpen
public boolean isOpen()Description copied from interface:DictionaryFileReturn true if the file is open -
close
public void close()Description copied from interface:DictionaryFileClose the file -
openFile
Description copied from class:AbstractDictionaryFileOpen the file at pathpath- Specified by:
openFilein classAbstractDictionaryFile- Throws:
IOException
-
length
Description copied from interface:RandomAccessDictionaryFileGet the length, in bytes, of the file- Throws:
IOException
-
read
Description copied from interface:RandomAccessDictionaryFileRead a byte from the file- Throws:
IOException
-