Package net.didion.jwnl.dictionary.file
Interface RandomAccessDictionaryFile
-
- All Superinterfaces:
DictionaryFile
- All Known Implementing Classes:
AbstractPrincetonRandomAccessDictionaryFile
,PrincetonChannelDictionaryFile
,PrincetonRandomAccessDictionaryFile
public interface RandomAccessDictionaryFile extends DictionaryFile
DictionaryFile
that reads lines from a random-access text file.
-
-
Field Summary
-
Fields inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
COMMENT_HEADER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getFilePointer()
Get the current position of the file pointer.long
getNextLineOffset()
Get the byte offset of the next line (after the position of the file pointer)boolean
isPreviousLineOffset(long offset)
Return true ifoffset
is the previous offset.long
length()
Get the length, in bytes, of the fileint
read()
Read a byte from the filejava.lang.String
readLine()
Read a line from the filevoid
seek(long pos)
Go to postion pos in the file.void
setNextLineOffset(long previousOffset, long nextOffset)
Move the file pointer so that its next line offset is nextOffset-
Methods inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
close, getFile, getFileType, getPOS, isOpen, newInstance, open
-
-
-
-
Method Detail
-
read
int read() throws java.io.IOException
Read a byte from the file- Throws:
java.io.IOException
-
readLine
java.lang.String readLine() throws java.io.IOException
Read a line from the file- Throws:
java.io.IOException
-
seek
void seek(long pos) throws java.io.IOException
Go to postion pos in the file.- Throws:
java.io.IOException
-
getFilePointer
long getFilePointer() throws java.io.IOException
Get the current position of the file pointer.- Throws:
java.io.IOException
-
length
long length() throws java.io.IOException
Get the length, in bytes, of the file- Throws:
java.io.IOException
-
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 ifoffset
is the previous offset.
-
getNextLineOffset
long getNextLineOffset()
Get the byte offset of the next line (after the position of the file pointer)
-
-