net.didion.jwnl.princeton.file
Class PrincetonObjectDictionaryFile

java.lang.Object
  extended by net.didion.jwnl.dictionary.file.AbstractDictionaryFile
      extended by net.didion.jwnl.princeton.file.AbstractPrincetonDictionaryFile
          extended by net.didion.jwnl.princeton.file.PrincetonObjectDictionaryFile
All Implemented Interfaces:
DictionaryFile, ObjectDictionaryFile

public class PrincetonObjectDictionaryFile
extends AbstractPrincetonDictionaryFile
implements ObjectDictionaryFile

ObjectDictionaryFile that accesses files names with the Princeton dictionary file naming convention.


Field Summary
 
Fields inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
COMMENT_HEADER
 
Constructor Summary
PrincetonObjectDictionaryFile()
           
PrincetonObjectDictionaryFile(java.lang.String path, POS pos, DictionaryFileType fileType)
           
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
 void close()
          Close the file
 java.io.ObjectInputStream getInputStream()
           
 java.io.ObjectOutputStream getOutputStream()
           
 boolean isOpen()
          Return true if the file is open
 DictionaryFile newInstance(java.lang.String path, POS pos, DictionaryFileType fileType)
          Create a new instance of the dictionary file
 void openStreams()
          Open the input and output streams.
 java.lang.Object readObject()
          Read and deserialize an object from the file
 void writeObject(java.lang.Object obj)
          Serialize and write an object ot the file.
 
Methods inherited from class net.didion.jwnl.dictionary.file.AbstractDictionaryFile
getFile, getFileType, getPOS, open
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
getFile, getFileType, getPOS, open
 

Constructor Detail

PrincetonObjectDictionaryFile

public PrincetonObjectDictionaryFile()

PrincetonObjectDictionaryFile

public PrincetonObjectDictionaryFile(java.lang.String path,
                                     POS pos,
                                     DictionaryFileType fileType)
Method Detail

newInstance

public DictionaryFile newInstance(java.lang.String path,
                                  POS pos,
                                  DictionaryFileType fileType)
Description copied from interface: DictionaryFile
Create a new instance of the dictionary file

Specified by:
newInstance in interface DictionaryFile

isOpen

public boolean isOpen()
Description copied from interface: DictionaryFile
Return true if the file is open

Specified by:
isOpen in interface DictionaryFile

close

public void close()
Description copied from interface: DictionaryFile
Close the file

Specified by:
close in interface DictionaryFile

openStreams

public void openStreams()
                 throws java.io.IOException
Open the input and output streams.

Throws:
java.io.IOException

getInputStream

public java.io.ObjectInputStream getInputStream()
                                         throws java.io.IOException
Throws:
java.io.IOException

getOutputStream

public java.io.ObjectOutputStream getOutputStream()
                                           throws java.io.IOException
Throws:
java.io.IOException

canRead

public boolean canRead()

canWrite

public boolean canWrite()

readObject

public java.lang.Object readObject()
                            throws java.io.IOException,
                                   java.lang.ClassNotFoundException
Description copied from interface: ObjectDictionaryFile
Read and deserialize an object from the file

Specified by:
readObject in interface ObjectDictionaryFile
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeObject

public void writeObject(java.lang.Object obj)
                 throws java.io.IOException
Description copied from interface: ObjectDictionaryFile
Serialize and write an object ot the file.

Specified by:
writeObject in interface ObjectDictionaryFile
Throws:
java.io.IOException