public class PrincetonObjectDictionaryFile extends AbstractPrincetonDictionaryFile implements ObjectDictionaryFile
ObjectDictionaryFile that accesses files names with the Princeton dictionary file naming convention.COMMENT_HEADER| Constructor and Description |
|---|
PrincetonObjectDictionaryFile() |
PrincetonObjectDictionaryFile(String path,
POS pos,
DictionaryFileType fileType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead() |
boolean |
canWrite() |
void |
close()
Close the file
|
ObjectInputStream |
getInputStream() |
ObjectOutputStream |
getOutputStream() |
boolean |
isOpen()
Return true if the file is open
|
DictionaryFile |
newInstance(String path,
POS pos,
DictionaryFileType fileType)
Create a new instance of the dictionary file
|
protected void |
openFile(File path)
Here we try to be intelligent about opening streams.
|
void |
openStreams()
Open the input and output streams.
|
Object |
readObject()
Read and deserialize an object from the file
|
void |
writeObject(Object obj)
Serialize and write an object ot the file.
|
makeFilenamegetFile, getFileType, getPOS, openclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFile, getFileType, getPOS, openpublic PrincetonObjectDictionaryFile()
public PrincetonObjectDictionaryFile(String path, POS pos, DictionaryFileType fileType)
public DictionaryFile newInstance(String path, POS pos, DictionaryFileType fileType)
DictionaryFilenewInstance in interface DictionaryFilepublic boolean isOpen()
DictionaryFileisOpen in interface DictionaryFilepublic void close()
DictionaryFileclose in interface DictionaryFilepublic void openStreams()
throws IOException
IOExceptionpublic ObjectInputStream getInputStream() throws IOException
IOExceptionpublic ObjectOutputStream getOutputStream() throws IOException
IOExceptionpublic boolean canRead()
public boolean canWrite()
public Object readObject() throws IOException, ClassNotFoundException
ObjectDictionaryFilereadObject in interface ObjectDictionaryFileIOExceptionClassNotFoundExceptionpublic void writeObject(Object obj) throws IOException
ObjectDictionaryFilewriteObject in interface ObjectDictionaryFileIOExceptionprotected void openFile(File path) throws IOException
openStreams.openFile in class AbstractDictionaryFileIOExceptionCopyright © 2019. All rights reserved.