public class PrincetonRandomAccessDictionaryFile extends AbstractPrincetonRandomAccessDictionaryFile
RandomAccessDictionaryFile that accesses files
named with Princeton's dictionary file naming convention.| Modifier and Type | Field and Description |
|---|---|
private java.io.RandomAccessFile |
_file
The random-access file.
|
protected java.lang.String |
_permissions
The file permissions to use when opening a file.
|
static java.lang.String |
READ_ONLY
Read-only file permission.
|
static java.lang.String |
READ_WRITE
Read-write file permission.
|
COMMENT_HEADER| Constructor and Description |
|---|
PrincetonRandomAccessDictionaryFile() |
PrincetonRandomAccessDictionaryFile(java.lang.String path,
POS pos,
DictionaryFileType fileType) |
PrincetonRandomAccessDictionaryFile(java.lang.String path,
POS pos,
DictionaryFileType fileType,
java.lang.String permissions) |
| 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(java.lang.String path,
POS pos,
DictionaryFileType fileType)
Create a new instance of the dictionary file
|
protected void |
openFile(java.io.File path)
Open the file at path
path |
int |
read()
Read a byte from the file
|
java.lang.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 static final java.lang.String READ_ONLY
public static final java.lang.String READ_WRITE
private java.io.RandomAccessFile _file
protected java.lang.String _permissions
public PrincetonRandomAccessDictionaryFile()
public PrincetonRandomAccessDictionaryFile(java.lang.String path,
POS pos,
DictionaryFileType fileType)
public PrincetonRandomAccessDictionaryFile(java.lang.String path,
POS pos,
DictionaryFileType fileType,
java.lang.String permissions)
public DictionaryFile newInstance(java.lang.String path, POS pos, DictionaryFileType fileType)
DictionaryFilepublic java.lang.String readLine()
throws java.io.IOException
RandomAccessDictionaryFilejava.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
RandomAccessDictionaryFilejava.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
RandomAccessDictionaryFilejava.io.IOExceptionpublic boolean isOpen()
DictionaryFilepublic void close()
DictionaryFileprotected void openFile(java.io.File path)
throws java.io.IOException
AbstractDictionaryFilepathopenFile in class AbstractDictionaryFilejava.io.IOExceptionpublic long length()
throws java.io.IOException
RandomAccessDictionaryFilejava.io.IOExceptionpublic int read()
throws java.io.IOException
RandomAccessDictionaryFilejava.io.IOException