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, setNextLineOffset
makeFilename
getFile, getFileType, getPOS, open
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFile, getFileType, getPOS, open
public PrincetonChannelDictionaryFile()
public PrincetonChannelDictionaryFile(String path, POS pos, DictionaryFileType fileType)
public DictionaryFile newInstance(String path, POS pos, DictionaryFileType fileType)
DictionaryFile
public String readLine() throws IOException
RandomAccessDictionaryFile
IOException
public void seek(long pos) throws IOException
RandomAccessDictionaryFile
IOException
public long getFilePointer() throws IOException
RandomAccessDictionaryFile
IOException
public boolean isOpen()
DictionaryFile
public void close()
DictionaryFile
protected void openFile(File file) throws IOException
AbstractDictionaryFile
path
openFile
in class AbstractDictionaryFile
IOException
public long length() throws IOException
RandomAccessDictionaryFile
IOException
public int read() throws IOException
RandomAccessDictionaryFile
IOException
Copyright © 2022. All rights reserved.