public interface FileManager extends java.rmi.Remote, Createable
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.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shut down the file manager.
|
long |
getFirstLinePointer(POS pos,
DictionaryFileType fileType)
Return the first valid line pointer in the specified file.
|
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, starting at offset.
|
long |
getNextLinePointer(POS pos,
DictionaryFileType fileType,
long offset)
Search for the line following the line that begins at offset.
|
long |
getRandomLinePointer(POS pos,
DictionaryFileType index)
Return a randomly-chosen line pointer (offset of the beginning of a line).
|
java.lang.String |
readLineAt(POS pos,
DictionaryFileType fileType,
long offset)
Read the line that begins at file offset offset.
|
createlong getIndexedLinePointer(POS pos, DictionaryFileType fileType, java.lang.String index) throws java.io.IOException, java.rmi.RemoteException
-1 if no such line exists.java.io.IOExceptionjava.rmi.RemoteExceptionjava.lang.String readLineAt(POS pos, DictionaryFileType fileType, long offset) throws java.io.IOException, java.rmi.RemoteException
java.io.IOExceptionjava.rmi.RemoteExceptionlong getNextLinePointer(POS pos, DictionaryFileType fileType, long offset) throws java.io.IOException, java.rmi.RemoteException
-1 if offset
is the last line in the file.java.io.IOExceptionjava.rmi.RemoteExceptionlong getMatchingLinePointer(POS pos, DictionaryFileType fileType, long offset, java.lang.String substring) throws java.io.IOException, java.rmi.RemoteException
-1 if
no such line exists.java.io.IOExceptionjava.rmi.RemoteExceptionlong getRandomLinePointer(POS pos, DictionaryFileType index) throws java.io.IOException
pos - index - java.io.IOExceptionlong getFirstLinePointer(POS pos, DictionaryFileType fileType) throws java.io.IOException
pos - fileType - java.io.IOExceptionvoid close()