technology.tabula.PageIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tabula Show documentation
Show all versions of tabula Show documentation
Extract tables from PDF files
package technology.tabula;
import java.io.IOException;
import java.util.Iterator;
public class PageIterator implements Iterator {
private ObjectExtractor oe;
private Iterator pageIndexIterator;
public PageIterator(ObjectExtractor oe, Iterable pages) {
super();
this.oe = oe;
this.pageIndexIterator = pages.iterator();
}
@Override
public boolean hasNext() {
return this.pageIndexIterator.hasNext();
}
@Override
public Page next() {
Page page = null;
if (!this.hasNext()) {
throw new IllegalStateException();
}
try {
page = oe.extractPage(this.pageIndexIterator.next());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return page;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy