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

org.gridgain.grid.util.GridWeakIterator Maven / Gradle / Ivy

package org.gridgain.grid.util;

import org.gridgain.grid.*;
import org.gridgain.grid.util.lang.*;

import java.lang.ref.*;
import java.util.*;

/**
 * Weak iterator.
 */
public class GridWeakIterator extends WeakReference> {
    /** Nested closeable iterator. */
    private final GridCloseableIterator it;

    /**
     * @param ref Referent.
     * @param it Closeable iterator.
     * @param q Referent queue.
     */
    public GridWeakIterator(Iterator ref, GridCloseableIterator it,
        ReferenceQueue> q) {
        super(ref, q);

        assert it != null;

        this.it = it;
    }

    /**
     * Closes iterator.
     *
     * @throws GridException If failed.
     */
    public void close() throws GridException {
        it.close();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy