public class PrincetonChannelDictionaryFile extends AbstractPrincetonRandomAccessDictionaryFile
RandomAccessDictionaryFile that accesses files named with Princeton's dictionary file naming convention.
Uses java.nio.channels.FileChannel for file access.COMMENT_HEADER| Constructor and Description |
|---|
PrincetonChannelDictionaryFile() |
PrincetonChannelDictionaryFile(String path,
POS pos,
DictionaryFileType fileType) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file
|
long |
getFilePointer()
Get the current position of the file pointer.
|
boolean |
isOpen()
Return true if the file is open
|
long |
length()
Get the length, in bytes, of the file
|
DictionaryFile |
newInstance(String path,
POS pos,
DictionaryFileType fileType)
Create a new instance of the dictionary file
|
protected void |
openFile(File file)
Open the file at path
path |
int |
read()
Read a byte from the file
|
String |
readLine()
Read a line from the file
|
void |
seek(long pos)
Go to postion pos in the file.
|
getNextLineOffset, isPreviousLineOffset, setNextLineOffsetmakeFilenamegetFile, getFileType, getPOS, openclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFile, getFileType, getPOS, openpublic PrincetonChannelDictionaryFile()
public PrincetonChannelDictionaryFile(String path, POS pos, DictionaryFileType fileType)
public DictionaryFile newInstance(String path, POS pos, DictionaryFileType fileType)
DictionaryFilepublic String readLine() throws IOException
RandomAccessDictionaryFileIOExceptionpublic void seek(long pos)
throws IOException
RandomAccessDictionaryFileIOExceptionpublic long getFilePointer()
throws IOException
RandomAccessDictionaryFileIOExceptionpublic boolean isOpen()
DictionaryFilepublic void close()
DictionaryFileprotected void openFile(File file) throws IOException
AbstractDictionaryFilepathopenFile in class AbstractDictionaryFileIOExceptionpublic long length()
throws IOException
RandomAccessDictionaryFileIOExceptionpublic int read()
throws IOException
RandomAccessDictionaryFileIOExceptionCopyright © 2023. All rights reserved.