edu.mit.jwi
Class DataSourceDictionary.FileIterator<T,N>

java.lang.Object
  extended by edu.mit.jwi.DataSourceDictionary.FileIterator<T,N>
All Implemented Interfaces:
IHasPOS, java.util.Iterator<N>
Direct Known Subclasses:
DataSourceDictionary.ExceptionFileIterator, DataSourceDictionary.FileIterator2
Enclosing class:
DataSourceDictionary

public abstract class DataSourceDictionary.FileIterator<T,N>
extends java.lang.Object
implements java.util.Iterator<N>, IHasPOS

Abstract class used for iterating over line-based files.


Field Summary
protected  java.lang.String currentLine
           
protected  IDataSource<T> fFile
           
protected  ILineParser<T> fParser
           
protected  java.util.Iterator<java.lang.String> iterator
           
 
Constructor Summary
DataSourceDictionary.FileIterator(IContentType<T> content)
           
DataSourceDictionary.FileIterator(IContentType<T> content, java.lang.String startKey)
           
 
Method Summary
 java.lang.String getCurrentLine()
          Returns the current line.
 POS getPOS()
          Returns the associated part of speech for this object.
 boolean hasNext()
           
 N next()
           
abstract  N parseLine(java.lang.String line)
          Parses the line using a parser provided at construction time
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fFile

protected final IDataSource<T> fFile

iterator

protected final java.util.Iterator<java.lang.String> iterator

fParser

protected final ILineParser<T> fParser

currentLine

protected java.lang.String currentLine
Constructor Detail

DataSourceDictionary.FileIterator

public DataSourceDictionary.FileIterator(IContentType<T> content)

DataSourceDictionary.FileIterator

public DataSourceDictionary.FileIterator(IContentType<T> content,
                                         java.lang.String startKey)
Method Detail

getCurrentLine

public java.lang.String getCurrentLine()
Returns the current line.

Returns:
the current line
Since:
JWI 2.2.0

getPOS

public POS getPOS()
Description copied from interface: IHasPOS
Returns the associated part of speech for this object. If this object is not associated with any particular part of speech, this method may return null.

Specified by:
getPOS in interface IHasPOS
Returns:
The associated part of speech, or null if none.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<N>

next

public N next()
Specified by:
next in interface java.util.Iterator<N>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<N>

parseLine

public abstract N parseLine(java.lang.String line)
Parses the line using a parser provided at construction time



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