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.
|
makeFilename
getFile, getFileType, getPOS, open
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFile, getFileType, getPOS, open
public PrincetonObjectDictionaryFile()
public PrincetonObjectDictionaryFile(String path, POS pos, DictionaryFileType fileType)
public DictionaryFile newInstance(String path, POS pos, DictionaryFileType fileType)
DictionaryFile
newInstance
in interface DictionaryFile
public boolean isOpen()
DictionaryFile
isOpen
in interface DictionaryFile
public void close()
DictionaryFile
close
in interface DictionaryFile
public void openStreams() throws IOException
IOException
public 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
ClassNotFoundException
public void writeObject(Object obj) throws IOException
ObjectDictionaryFile
writeObject
in interface ObjectDictionaryFile
IOException
protected void openFile(File path) throws IOException
openStreams
.openFile
in class AbstractDictionaryFile
IOException
Copyright © 2017. All rights reserved.