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.IteratorA 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_currentLineprivate long_currentOffsetprotected DictionaryFileType_fileTypeprivate boolean_moreprivate long_nextOffsetprotected 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 longgetNextOffset(long currentOffset)booleanhasNext()java.lang.Objectnext()protected voidnextLine()Read the next line in the iterated file.protected voidnextOffset()protected abstract java.lang.ObjectparseLine(POS pos, long offset, java.lang.String line)voidremove()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:
nextin interfacejava.util.Iterator
-
hasNext
public final boolean hasNext()
- Specified by:
hasNextin 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:
removein 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
-
-