/** * 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); } }
/** * @return {@code true} if the loop with the specified name * is on its first iteration. * @param name loop name */ public Boolean isFirst(String name) { // just tell the matching one to skip ManagedIterator iterator = findIterator(name); if (iterator != null) { return iterator.isFirst(); } return null; }
/** * @return {@code true} if the loop with the specified name * is on its last iteration. * @param name loop name */ public Boolean isLast(String name) { // just tell the matching one to skip ManagedIterator iterator = findIterator(name); if (iterator != null) { return iterator.isLast(); } return null; }
/** * Asks the loop with the specified name for the current value * of the specified sync'ed iterator, if any. * @param name loop name * @param synced sync'ed Iterator name * @return current iterator value */ public Object get(String name, String synced) { // just ask the matching iterator for the sync'ed value ManagedIterator iterator = findIterator(name); if (iterator != null) { return iterator.get(synced); } return null; }
/** * Returns the number of items the specified loop has handled. So, if this * is the first iteration, then the count will be 1. If you {@link #skip} * ahead in this loop, those skipped iterations will still be included in * the count. * @param name loop name * @return loop items count */ public Integer getCount(String name) { // just tell the matching one to skip ManagedIterator iterator = findIterator(name); if (iterator != null) { return iterator.getCount(); } return null; }