All Downloads are FREE. Search and download functionalities are using the official Maven repository.

technology.tabula.PageIterator Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
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