uk.ac.man.documentparser.input
Class Directory

java.lang.Object
  extended by uk.ac.man.documentparser.input.Directory
All Implemented Interfaces:
java.lang.Iterable<Document>, java.util.Iterator<Document>, DocumentIterator

public class Directory
extends java.lang.Object
implements DocumentIterator


Field Summary
private  java.lang.String acceptedSuffix
           
private  java.io.File[] contents
           
private  DocumentIterator currentFileIterator
           
private  DocumentIterator currentSubDirectory
           
private  InputFactory factory
           
private  int nextDocIndex
           
private  Document nextDocument
           
private  boolean recursive
           
 
Constructor Summary
Directory(java.io.File dir, InputFactory factory, java.lang.String acceptedSuffix, boolean recursive)
           
 
Method Summary
private  void fetchNext()
           
 boolean hasNext()
           
 java.util.Iterator<Document> iterator()
           
 Document next()
           
 void remove()
           
 void skip()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contents

private java.io.File[] contents

nextDocIndex

private int nextDocIndex

nextDocument

private Document nextDocument

acceptedSuffix

private java.lang.String acceptedSuffix

recursive

private boolean recursive

factory

private InputFactory factory

currentSubDirectory

private DocumentIterator currentSubDirectory

currentFileIterator

private DocumentIterator currentFileIterator
Constructor Detail

Directory

public Directory(java.io.File dir,
                 InputFactory factory,
                 java.lang.String acceptedSuffix,
                 boolean recursive)
Method Detail

fetchNext

private void fetchNext()

skip

public void skip()
Specified by:
skip in interface DocumentIterator

hasNext

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

next

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

remove

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

iterator

public java.util.Iterator<Document> iterator()
Specified by:
iterator in interface java.lang.Iterable<Document>