public abstract class AbstractPrincetonObjectDictionaryFile extends AbstractPrincetonDictionaryFile implements ObjectDictionaryFile
ObjectDictionaryFiles that access files with the Princeton dictionary file naming convention.| Modifier and Type | Field and Description |
|---|---|
protected java.io.ObjectInputStream |
in |
protected java.io.ObjectOutputStream |
out |
dictionary, fileType, params, path, pos| Modifier | Constructor and Description |
|---|---|
|
AbstractPrincetonObjectDictionaryFile(Dictionary dictionary,
java.util.Map<java.lang.String,Param> params)
Factory constructor.
|
protected |
AbstractPrincetonObjectDictionaryFile(Dictionary dictionary,
java.lang.String path,
POS pos,
DictionaryFileType fileType,
java.util.Map<java.lang.String,Param> params)
Instance constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canRead() |
protected boolean |
canWrite() |
void |
close()
Closes the file.
|
protected void |
closeStreams(java.io.InputStream in,
java.io.OutputStream out) |
void |
edit()
Reopens file in write mode.
|
protected java.io.ObjectInputStream |
getInputStream() |
protected java.io.ObjectOutputStream |
getOutputStream() |
boolean |
isOpen()
Returns true if the file is open.
|
abstract void |
open()
Here we try to be intelligent about opening streams.
|
protected abstract void |
openInputStream() |
protected abstract void |
openOutputStream() |
protected void |
openStreams()
Open the input and output streams.
|
java.lang.Object |
readObject()
Reads and deserializes an object from the file.
|
void |
save()
Saves the file.
|
void |
writeObject(java.lang.Object obj)
Serializes and write an object ot the file.
|
getFilenamegetDictionary, getFileType, getPOS, setDictionaryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFilename, getFileType, getPOSgetDictionary, setDictionarypublic AbstractPrincetonObjectDictionaryFile(Dictionary dictionary, java.util.Map<java.lang.String,Param> params)
dictionary - dictionaryparams - paramsprotected AbstractPrincetonObjectDictionaryFile(Dictionary dictionary, java.lang.String path, POS pos, DictionaryFileType fileType, java.util.Map<java.lang.String,Param> params)
dictionary - dictionarypath - file pathpos - part of speechfileType - file typeparams - paramspublic boolean isOpen()
DictionaryFileisOpen in interface DictionaryFilepublic void save()
throws JWNLException
DictionaryFilesave in interface DictionaryFileJWNLException - JWNLExceptionpublic void close()
DictionaryFileclose in interface DictionaryFileprotected void closeStreams(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void edit()
throws JWNLException
DictionaryFileedit in interface DictionaryFileJWNLException - JWNLExceptionprotected void openStreams()
throws JWNLException
JWNLException - JWNLExceptionprotected abstract void openOutputStream()
throws JWNLException
JWNLExceptionprotected abstract void openInputStream()
throws JWNLException
JWNLExceptionprotected java.io.ObjectInputStream getInputStream()
throws JWNLException
JWNLExceptionprotected java.io.ObjectOutputStream getOutputStream()
throws JWNLException
JWNLExceptionprotected boolean canRead()
protected boolean canWrite()
public java.lang.Object readObject()
throws JWNLException
ObjectDictionaryFilereadObject in interface ObjectDictionaryFileJWNLException - JWNLExceptionpublic void writeObject(java.lang.Object obj)
throws JWNLException
ObjectDictionaryFilewriteObject in interface ObjectDictionaryFileobj - object to writeJWNLException - JWNLExceptionpublic abstract void open()
throws JWNLException
openStreams.open in interface DictionaryFileJWNLException - JWNLException