edu.mit.jwi.data
Class BinarySearchWordnetFile.BinarySearchLineIterator

java.lang.Object
  extended by edu.mit.jwi.data.WordnetFile.LineIterator
      extended by edu.mit.jwi.data.BinarySearchWordnetFile.BinarySearchLineIterator
All Implemented Interfaces:
java.util.Iterator<java.lang.String>
Enclosing class:
BinarySearchWordnetFile<T>

public class BinarySearchWordnetFile.BinarySearchLineIterator
extends WordnetFile.LineIterator

Used to iterate over lines in a file. It is a look-ahead iterator. Does not support the WordnetFile.LineIterator.remove() method; if that method is called, it will throw an UnsupportedOperationException.

Since:
JWI 2.0.0
Version:
2.4.0
Author:
Mark A. Finlayson

Field Summary
 
Fields inherited from class edu.mit.jwi.data.WordnetFile.LineIterator
itrBuffer, next, parentBuffer
 
Constructor Summary
BinarySearchWordnetFile.BinarySearchLineIterator(java.nio.ByteBuffer buffer, java.lang.String key)
          Constructs a new line iterator over this buffer, starting at the specified key.
 
Method Summary
protected  void findFirstLine(java.lang.String key)
          Advances the iterator the first line the iterator should return, based on the specified key.
 
Methods inherited from class edu.mit.jwi.data.WordnetFile.LineIterator
advance, getNextLine, hasNext, isComment, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinarySearchWordnetFile.BinarySearchLineIterator

public BinarySearchWordnetFile.BinarySearchLineIterator(java.nio.ByteBuffer buffer,
                                                        java.lang.String key)
Constructs a new line iterator over this buffer, starting at the specified key.

Parameters:
buffer - the buffer over which the iterator should iterator; may not be null
key - the key of the line to start at; may be null
Throws:
java.lang.NullPointerException - if the specified buffer is null
Since:
JWI 2.0.0
Method Detail

findFirstLine

protected void findFirstLine(java.lang.String key)
Description copied from class: WordnetFile.LineIterator
Advances the iterator the first line the iterator should return, based on the specified key. If the key is not found in the file, it will advance the iterator past all lines.

Specified by:
findFirstLine in class WordnetFile.LineIterator
Parameters:
key - the key indexed the first line to be returned by the iterator


Copyright © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.