public interface FileManager extends 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,
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,
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).
|
String |
readLineAt(POS pos,
DictionaryFileType fileType,
long offset)
Read the line that begins at file offset offset.
|
create
long getIndexedLinePointer(POS pos, DictionaryFileType fileType, String index) throws IOException, RemoteException
-1
if no such line exists.IOException
RemoteException
String readLineAt(POS pos, DictionaryFileType fileType, long offset) throws IOException, RemoteException
IOException
RemoteException
long getNextLinePointer(POS pos, DictionaryFileType fileType, long offset) throws IOException, RemoteException
-1
if offset
is the last line in the file.IOException
RemoteException
long getMatchingLinePointer(POS pos, DictionaryFileType fileType, long offset, String substring) throws IOException, RemoteException
-1
if
no such line exists.IOException
RemoteException
long getRandomLinePointer(POS pos, DictionaryFileType index) throws IOException
pos
- index
- IOException
long getFirstLinePointer(POS pos, DictionaryFileType fileType) throws IOException
pos
- fileType
- IOException
void close()
Copyright © 2022. All rights reserved.