public class PrincetonObjectDictionaryFile extends AbstractPrincetonObjectDictionaryFile implements DictionaryDiskFile, DictionaryFileFactory<PrincetonObjectDictionaryFile>
ObjectDictionaryFile
that loads dictionary files from file system.Modifier and Type | Field and Description |
---|---|
protected java.io.File |
file |
in, out
dictionary, fileType, params, path, pos
Constructor and Description |
---|
PrincetonObjectDictionaryFile(Dictionary dictionary,
java.util.Map<java.lang.String,Param> params)
Factory constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file.
|
boolean |
delete()
Deletes the file.
|
java.io.File |
getFile()
Returns the file.
|
PrincetonObjectDictionaryFile |
newInstance(Dictionary dictionary,
java.lang.String path,
POS pos,
DictionaryFileType fileType)
Creates a new instance of dictionary file.
|
void |
open()
Here we try to be intelligent about opening streams.
|
protected void |
openInputStream() |
protected void |
openOutputStream() |
canRead, canWrite, closeStreams, edit, getInputStream, getOutputStream, isOpen, openStreams, readObject, save, writeObject
getFilename
getDictionary, getFileType, getPOS, setDictionary
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
edit, getFilename, getFileType, getPOS, isOpen, save
getDictionary, setDictionary
public PrincetonObjectDictionaryFile(Dictionary dictionary, java.util.Map<java.lang.String,Param> params)
dictionary
- dictionaryparams
- paramspublic PrincetonObjectDictionaryFile newInstance(Dictionary dictionary, java.lang.String path, POS pos, DictionaryFileType fileType)
DictionaryFileFactory
newInstance
in interface DictionaryFileFactory<PrincetonObjectDictionaryFile>
dictionary
- owner dictionarypath
- path to dictionary filespos
- part of speechfileType
- file typepublic void close()
DictionaryFile
close
in interface DictionaryFile
close
in class AbstractPrincetonObjectDictionaryFile
protected void openOutputStream() throws JWNLException
openOutputStream
in class AbstractPrincetonObjectDictionaryFile
JWNLException
protected void openInputStream() throws JWNLException
openInputStream
in class AbstractPrincetonObjectDictionaryFile
JWNLException
public void open() throws JWNLException
openStreams
.open
in interface DictionaryFile
open
in class AbstractPrincetonObjectDictionaryFile
JWNLException
- JWNLExceptionpublic boolean delete() throws JWNLException
DictionaryDiskFile
delete
in interface DictionaryDiskFile
JWNLException
- JWNLExceptionpublic java.io.File getFile()
DictionaryDiskFile
getFile
in interface DictionaryDiskFile