/** * Skips ahead the specified number of iterations (if possible). * Since this is manual skipping (unlike the automatic skipping * provided by the likes of {@link ManagedIterator#exclude(Object)}, any elements * skipped are still considered in the results returned by {@link #getCount()} * and {@link #isFirst()}. * @param number number of iterations */ public void skip(int number) { // if we have an iterator on the stack if (!iterators.empty()) { // tell the top one to skip the specified number skip(number, iterators.peek()); } }
/** * This tells the specified loop to skip ahead the specified number of * iterations. * @param number number of iterations * @param name loop name * @see #skip(int) */ public void skip(int number, String name) { // just tell the matching one to skip ManagedIterator iterator = findIterator(name); if (iterator != null) { skip(number, iterator); } }