Interface RandomAccessDictionaryFile
- All Superinterfaces:
DictionaryFile
- All Known Implementing Classes:
AbstractPrincetonRandomAccessDictionaryFile, PrincetonChannelDictionaryFile, PrincetonRandomAccessDictionaryFile
DictionaryFile that reads lines from a random-access text file.-
Field Summary
Fields inherited from interface DictionaryFile
COMMENT_HEADER -
Method Summary
Modifier and TypeMethodDescriptionlongGet the current position of the file pointer.longGet the byte offset of the next line (after the position of the file pointer)booleanisPreviousLineOffset(long offset) Return true ifoffsetis the previous offset.longlength()Get the length, in bytes, of the fileintread()Read a byte from the filereadLine()Read a line from the filevoidseek(long pos) Go to postion pos in the file.voidsetNextLineOffset(long previousOffset, long nextOffset) Move the file pointer so that its next line offset is nextOffsetMethods inherited from interface DictionaryFile
close, getFile, getFileType, getPOS, isOpen, newInstance, open
-
Method Details
-
read
-
readLine
-
seek
-
getFilePointer
Get the current position of the file pointer.- Throws:
IOException
-
length
-
setNextLineOffset
void setNextLineOffset(long previousOffset, long nextOffset) Move the file pointer so that its next line offset is nextOffset -
isPreviousLineOffset
boolean isPreviousLineOffset(long offset) Return true ifoffsetis the previous offset. -
getNextLineOffset
long getNextLineOffset()Get the byte offset of the next line (after the position of the file pointer)
-