Package net.didion.jwnl.princeton.file
Class AbstractPrincetonRandomAccessDictionaryFile
- java.lang.Object
-
- net.didion.jwnl.dictionary.file.AbstractDictionaryFile
-
- net.didion.jwnl.princeton.file.AbstractPrincetonDictionaryFile
-
- net.didion.jwnl.princeton.file.AbstractPrincetonRandomAccessDictionaryFile
-
- All Implemented Interfaces:
DictionaryFile
,RandomAccessDictionaryFile
- Direct Known Subclasses:
PrincetonChannelDictionaryFile
,PrincetonRandomAccessDictionaryFile
public abstract class AbstractPrincetonRandomAccessDictionaryFile extends AbstractPrincetonDictionaryFile implements RandomAccessDictionaryFile
-
-
Field Summary
Fields Modifier and Type Field Description private long
_nextOffset
Used for caching the offset of the line following the line atpreviousOffset
.private long
_previousOffset
Used for caching the previously accessed file offset.-
Fields inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
COMMENT_HEADER
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractPrincetonRandomAccessDictionaryFile()
protected
AbstractPrincetonRandomAccessDictionaryFile(java.lang.String path, POS pos, DictionaryFileType fileType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
setNextLineOffset(long previousOffset, long nextOffset)
Move the file pointer so that its next line offset is nextOffset-
Methods inherited from class net.didion.jwnl.princeton.file.AbstractPrincetonDictionaryFile
makeFilename
-
Methods inherited from class net.didion.jwnl.dictionary.file.AbstractDictionaryFile
getFile, getFileType, getPOS, open, openFile
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.didion.jwnl.dictionary.file.DictionaryFile
close, getFile, getFileType, getPOS, isOpen, newInstance, open
-
Methods inherited from interface net.didion.jwnl.dictionary.file.RandomAccessDictionaryFile
getFilePointer, length, read, readLine, seek
-
-
-
-
Constructor Detail
-
AbstractPrincetonRandomAccessDictionaryFile
public AbstractPrincetonRandomAccessDictionaryFile()
-
AbstractPrincetonRandomAccessDictionaryFile
protected AbstractPrincetonRandomAccessDictionaryFile(java.lang.String path, POS pos, DictionaryFileType fileType)
-
-
Method Detail
-
setNextLineOffset
public void setNextLineOffset(long previousOffset, long nextOffset)
Description copied from interface:RandomAccessDictionaryFile
Move the file pointer so that its next line offset is nextOffset- Specified by:
setNextLineOffset
in interfaceRandomAccessDictionaryFile
-
isPreviousLineOffset
public boolean isPreviousLineOffset(long offset)
Description copied from interface:RandomAccessDictionaryFile
Return true ifoffset
is the previous offset.- Specified by:
isPreviousLineOffset
in interfaceRandomAccessDictionaryFile
-
getNextLineOffset
public long getNextLineOffset()
Description copied from interface:RandomAccessDictionaryFile
Get the byte offset of the next line (after the position of the file pointer)- Specified by:
getNextLineOffset
in interfaceRandomAccessDictionaryFile
-
-