Package net.didion.jwnl.dictionary
Class FileBackedDictionary.FileLookaheadIterator
- java.lang.Object
-
- net.didion.jwnl.dictionary.FileBackedDictionary.FileLookaheadIterator
-
- All Implemented Interfaces:
java.util.Iterator
- Direct Known Subclasses:
FileBackedDictionary.IndexFileLookaheadIterator
- Enclosing class:
- FileBackedDictionary
private abstract class FileBackedDictionary.FileLookaheadIterator extends java.lang.Object implements java.util.Iterator
A lookahead iterator over a dictionary file. Each element in the enumeration is a line in the enumerated file.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
_currentLine
private long
_currentOffset
protected DictionaryFileType
_fileType
private boolean
_more
private long
_nextOffset
protected POS
_pos
-
Constructor Summary
Constructors Constructor Description FileLookaheadIterator(POS pos, DictionaryFileType fileType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected long
getNextOffset(long currentOffset)
boolean
hasNext()
java.lang.Object
next()
protected void
nextLine()
Read the next line in the iterated file.protected void
nextOffset()
protected abstract java.lang.Object
parseLine(POS pos, long offset, java.lang.String line)
void
remove()
This method can be over-ridden to remove the currently pointed-at object from the data source backing the iterator.
-
-
-
Field Detail
-
_currentLine
private java.lang.String _currentLine
-
_currentOffset
private long _currentOffset
-
_nextOffset
private long _nextOffset
-
_more
private boolean _more
-
_pos
protected POS _pos
-
_fileType
protected DictionaryFileType _fileType
-
-
Constructor Detail
-
FileLookaheadIterator
public FileLookaheadIterator(POS pos, DictionaryFileType fileType)
-
-
Method Detail
-
parseLine
protected abstract java.lang.Object parseLine(POS pos, long offset, java.lang.String line)
-
next
public final java.lang.Object next()
- Specified by:
next
in interfacejava.util.Iterator
-
hasNext
public final boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator
-
remove
public void remove()
This method can be over-ridden to remove the currently pointed-at object from the data source backing the iterator.- Specified by:
remove
in interfacejava.util.Iterator
-
nextLine
protected final void nextLine()
Read the next line in the iterated file.
-
nextOffset
protected final void nextOffset() throws JWNLException
- Throws:
JWNLException
-
getNextOffset
protected long getNextOffset(long currentOffset) throws JWNLException
- Throws:
JWNLException
-
-