public abstract class AbstractDictionaryFile extends java.lang.Object implements DictionaryFile
DictionaryFile. This class
should be implemented for each file naming scheme used. It is assumed that each
file will be associated with both a POS and a file type (e.g. in the windows
naming scheme, the verb index file is called "verb.idx").| Modifier and Type | Field and Description |
|---|---|
private java.io.File |
_file |
private DictionaryFileType |
_fileType
The type of the file.
|
private POS |
_pos |
COMMENT_HEADER| Modifier | Constructor and Description |
|---|---|
|
AbstractDictionaryFile() |
protected |
AbstractDictionaryFile(java.lang.String path,
POS pos,
DictionaryFileType fileType) |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
getFile() |
DictionaryFileType |
getFileType()
The file type associated with this file.
|
POS |
getPOS()
The POS associated with this file.
|
protected abstract java.lang.String |
makeFilename()
Build a filename from the part-of-speech and the file type.
|
void |
open()
Open the file.
|
protected abstract void |
openFile(java.io.File file)
Open the file at path
path |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, isOpen, newInstanceprivate POS _pos
private DictionaryFileType _fileType
private java.io.File _file
public AbstractDictionaryFile()
protected AbstractDictionaryFile(java.lang.String path,
POS pos,
DictionaryFileType fileType)
protected abstract java.lang.String makeFilename()
protected abstract void openFile(java.io.File file)
throws java.io.IOException
pathjava.io.IOExceptionpublic POS getPOS()
getPOS in interface DictionaryFilepublic java.io.File getFile()
getFile in interface DictionaryFilepublic DictionaryFileType getFileType()
getFileType in interface DictionaryFilepublic void open()
throws java.io.IOException
open in interface DictionaryFilejava.io.IOException