|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.extjwnl.dictionary.file.AbstractDictionaryFile
net.sf.extjwnl.princeton.file.AbstractPrincetonDictionaryFile
net.sf.extjwnl.princeton.file.PrincetonObjectDictionaryFile
public class PrincetonObjectDictionaryFile
ObjectDictionaryFile
that accesses files names with the Princeton dictionary file naming convention.
Field Summary |
---|
Fields inherited from class net.sf.extjwnl.dictionary.file.AbstractDictionaryFile |
---|
dictionary, file, params |
Constructor Summary | |
---|---|
PrincetonObjectDictionaryFile(Dictionary dictionary,
Map<String,Param> params)
|
|
PrincetonObjectDictionaryFile(Dictionary dictionary,
String path,
POS pos,
DictionaryFileType fileType,
Map<String,Param> params)
|
Method Summary | |
---|---|
boolean |
canRead()
|
boolean |
canWrite()
|
void |
close()
Closes the file. |
void |
edit()
Reopens file in write mode. |
ObjectInputStream |
getInputStream()
|
ObjectOutputStream |
getOutputStream()
|
boolean |
isOpen()
Returns true if the file is open. |
PrincetonObjectDictionaryFile |
newInstance(Dictionary dictionary,
String path,
POS pos,
DictionaryFileType fileType)
Creates a new instance of the dictionary file. |
protected void |
openFile()
Here we try to be intelligent about opening streams. |
void |
openStreams()
Open the input and output streams. |
Object |
readObject()
Reads and deserializes an object from the file. |
void |
save()
Saves the file. |
void |
writeObject(Object obj)
Serializes and write an object ot the file. |
Methods inherited from class net.sf.extjwnl.princeton.file.AbstractPrincetonDictionaryFile |
---|
getFilename |
Methods inherited from class net.sf.extjwnl.dictionary.file.AbstractDictionaryFile |
---|
delete, getDictionary, getFile, getFileType, getPOS, open, setDictionary |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.extjwnl.dictionary.file.DictionaryFile |
---|
delete, getFile, getFileType, getPOS, open |
Methods inherited from interface net.sf.extjwnl.util.factory.Owned |
---|
getDictionary, setDictionary |
Constructor Detail |
---|
public PrincetonObjectDictionaryFile(Dictionary dictionary, Map<String,Param> params)
public PrincetonObjectDictionaryFile(Dictionary dictionary, String path, POS pos, DictionaryFileType fileType, Map<String,Param> params)
Method Detail |
---|
public PrincetonObjectDictionaryFile newInstance(Dictionary dictionary, String path, POS pos, DictionaryFileType fileType)
DictionaryFileFactory
newInstance
in interface DictionaryFileFactory<PrincetonObjectDictionaryFile>
dictionary
- owner dictionarypath
- path to dictionary filespos
- part of speechfileType
- file type
public boolean isOpen()
DictionaryFile
isOpen
in interface DictionaryFile
public void save() throws IOException
DictionaryFile
save
in interface DictionaryFile
IOException
- IOExceptionpublic void close()
DictionaryFile
close
in interface DictionaryFile
close
in class AbstractDictionaryFile
public void edit() throws IOException
DictionaryFile
edit
in interface DictionaryFile
IOException
- IOExceptionpublic void openStreams() throws IOException
IOException
- IOExceptionpublic ObjectInputStream getInputStream() throws IOException
IOException
public ObjectOutputStream getOutputStream() throws IOException
IOException
public boolean canRead()
public boolean canWrite()
public Object readObject() throws IOException, ClassNotFoundException
ObjectDictionaryFile
readObject
in interface ObjectDictionaryFile
IOException
- IOException
ClassNotFoundException
- ClassNotFoundExceptionpublic void writeObject(Object obj) throws IOException
ObjectDictionaryFile
writeObject
in interface ObjectDictionaryFile
obj
- object to write
IOException
- IOExceptionprotected void openFile() throws IOException
openStreams
.
openFile
in class AbstractDictionaryFile
IOException
- IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |