public class PrincetonRandomAccessDictionaryFile extends AbstractPrincetonRandomAccessDictionaryFile
RandomAccessDictionaryFile that accesses files
named with Princeton's dictionary file naming convention.| Modifier and Type | Field and Description |
|---|---|
protected String |
_permissions
The file permissions to use when opening a file.
|
static String |
READ_ONLY
Read-only file permission.
|
static String |
READ_WRITE
Read-write file permission.
|
COMMENT_HEADER| Constructor and Description |
|---|
PrincetonRandomAccessDictionaryFile() |
PrincetonRandomAccessDictionaryFile(String path,
POS pos,
DictionaryFileType fileType) |
PrincetonRandomAccessDictionaryFile(String path,
POS pos,
DictionaryFileType fileType,
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(String path,
POS pos,
DictionaryFileType fileType)
Create a new instance of the dictionary file
|
protected void |
openFile(File path)
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 static final String READ_ONLY
public static final String READ_WRITE
protected String _permissions
public PrincetonRandomAccessDictionaryFile()
public PrincetonRandomAccessDictionaryFile(String path, POS pos, DictionaryFileType fileType)
public PrincetonRandomAccessDictionaryFile(String path, POS pos, DictionaryFileType fileType, String permissions)
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 path) throws IOException
AbstractDictionaryFilepathopenFile in class AbstractDictionaryFileIOExceptionpublic long length()
throws IOException
RandomAccessDictionaryFileIOExceptionpublic int read()
throws IOException
RandomAccessDictionaryFileIOExceptionCopyright © 2023. All rights reserved.