/** * Returns the index in the data list for the given position. This method * also checks the reverse flag. * * @param pos the position (1-based) * @return the corresponding list index */ protected int positionToIndex(final int pos) { return (reverse ? 1 - pos : pos - 1) + getStartOffset(); }
/** * Returns the maximum position for this iterator. * * @return the maximum allowed position */ protected int getMaxPosition() { return reverse ? getStartOffset() + 1 : size() - getStartOffset(); }