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, setNextLineOffset
makeFilename
getFile, getFileType, getPOS, open
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFile, getFileType, getPOS, open
public 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)
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 path) throws IOException
AbstractDictionaryFile
path
openFile
in class AbstractDictionaryFile
IOException
public long length() throws IOException
RandomAccessDictionaryFile
IOException
public int read() throws IOException
RandomAccessDictionaryFile
IOException
Copyright © 2020. All rights reserved.