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

javax.jcr.RangeIterator Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
/*
 * Copyright 2009 Day Management AG, Switzerland. All rights reserved.
 */
package javax.jcr;

import java.util.Iterator;

/**
 * Extends Iterator with the skip,
 * getSize and getPosition methods. The base interface
 * of all type-specific iterators in the javax.jcr and its sub
 * packages.
 */
public interface RangeIterator extends Iterator {

    /**
     * Skip a number of elements in the iterator.
     *
     * @param skipNum the non-negative number of elements to skip
     * @throws java.util.NoSuchElementException
     *          if skipped past the last element
     *          in the iterator.
     */
    public void skip(long skipNum);

    /**
     * Returns the total number of of items available through this iterator. For
     * example, for some node N, N.getNodes().getSize()
     * returns the number of child nodes of N visible through the
     * current Session. In some implementations precise information
     * about the number of elements may not be available. In such cases this
     * method must return -1. API clients will then be able to use
     * RangeIterator.getNumberRemaining to get an estimate on the
     * number of elements.
     *
     * @return a long
     */
    public long getSize();

    /**
     * Returns the current position within the iterator. The number returned is
     * the 0-based index of the next element in the iterator, i.e. the one that
     * will be returned on the subsequent next call.
     * 

* Note that this method does not check if there is a next element, i.e. an * empty iterator will always return 0. * * @return a long */ public long getPosition(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy