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

net.fortytwo.sesametools.QueryEvaluationIteration Maven / Gradle / Ivy


package net.fortytwo.sesametools;

import info.aduna.iteration.CloseableIteration;
import org.openrdf.model.Statement;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.sail.SailException;

/**
 * Created by IntelliJ IDEA.
 * User: josh
 * Date: Nov 26, 2007
 * Time: 11:05:52 AM
 * To change this template use File | Settings | File Templates.
 */
public class QueryEvaluationIteration implements CloseableIteration {
    private CloseableIteration baseIteration;

    public QueryEvaluationIteration(final CloseableIteration baseIteration) {
        this.baseIteration = baseIteration;
    }

    public void close() throws QueryEvaluationException {
        try {
            baseIteration.close();
        }

        catch (SailException e) {
            throw new QueryEvaluationException(e);
        }
    }

    public boolean hasNext() throws QueryEvaluationException {
        try {
            return baseIteration.hasNext();
        }

        catch (SailException e) {
            throw new QueryEvaluationException(e);
        }
    }

    public Statement next() throws QueryEvaluationException {
        try {
            return baseIteration.next();
        }

        catch (SailException e) {
            throw new QueryEvaluationException(e);
        }
    }

    public void remove() throws QueryEvaluationException {
        try {
            baseIteration.remove();
        }

        catch (SailException e) {
            throw new QueryEvaluationException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy