net.didion.jwnl.dictionary.file_manager
Interface FileManager

All Superinterfaces:
Creatable, java.rmi.Remote
All Known Implementing Classes:
FileManagerImpl

public interface FileManager
extends java.rmi.Remote, Creatable

FileManager defines the interface between the FileBackedDictionary and the file system. Methods in this interface operate on and return offsets, which are indices into a dictionary file.


Method Summary
 void close()
          Shut down the file manager.
 long getIndexedLinePointer(POS pos, DictionaryFileType fileType, java.lang.String index)
          Search for the line whose first word is index (that is, that begins with * index followed by a space or tab).
 long getMatchingLinePointer(POS pos, DictionaryFileType fileType, long offset, java.lang.String substring)
          Search for a line whose index word contains substring.
 long getNextLinePointer(POS pos, DictionaryFileType fileType, long offset)
          Search for the line following the line that begins at offset.
 java.lang.String readLineAt(POS pos, DictionaryFileType fileType, long offset)
          Read the line that begins at file offset offset.
 
Methods inherited from interface net.didion.jwnl.util.Creatable
create
 

Method Detail

getIndexedLinePointer

public long getIndexedLinePointer(POS pos,
                                  DictionaryFileType fileType,
                                  java.lang.String index)
                           throws java.io.IOException,
                                  java.rmi.RemoteException
Search for the line whose first word is index (that is, that begins with * index followed by a space or tab). * @return The file offset of the start of the matching line, or -1 if no such line exists.


readLineAt

public java.lang.String readLineAt(POS pos,
                                   DictionaryFileType fileType,
                                   long offset)
                            throws java.io.IOException,
                                   java.rmi.RemoteException
Read the line that begins at file offset offset.


getNextLinePointer

public long getNextLinePointer(POS pos,
                               DictionaryFileType fileType,
                               long offset)
                        throws java.io.IOException,
                               java.rmi.RemoteException
Search for the line following the line that begins at offset. * @return The file offset of the start of the line, or -1 if offset * is the last line in the file.


getMatchingLinePointer

public long getMatchingLinePointer(POS pos,
                                   DictionaryFileType fileType,
                                   long offset,
                                   java.lang.String substring)
                            throws java.io.IOException,
                                   java.rmi.RemoteException
Search for a line whose index word contains substring. * @return The file offset of the start of the matchng line, or -1 if * no such line exists.


close

public void close()
Shut down the file manager.




JWNL homepage.