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

com.microsoft.azure.documentdb.internal.query.executioncomponent.QueryExecutionComponent Maven / Gradle / Ivy

package com.microsoft.azure.documentdb.internal.query.executioncomponent;

import java.util.*;

import com.microsoft.azure.documentdb.*;
import com.microsoft.azure.documentdb.internal.query.QueryExecutionContext;

public abstract class QueryExecutionComponent implements QueryExecutionContext {
    protected final QueryExecutionContext source;

    protected QueryExecutionComponent(QueryExecutionContext source) {
        this.source = source;
    }

    @Override
    public List fetchNextBlock() throws DocumentClientException {
        throw new UnsupportedOperationException("fetchNextBlock");
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("remove");
    }

    @Override
    public Document next() {
        if (!this.hasNext()) {
            throw new NoSuchElementException("next");
        }

        Document document = this.source.next();
        return document == null ? document : this.next(document);
    }

    @Override
    public void onNotifyStop() {
        this.source.onNotifyStop();
    }

    abstract protected Document next(Document document);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy