public iteratorWrapper(Iterator<? extends T> iterator, int start, int end) { BoundedIterator.checkConstraints(start, end); iter_ = iterator; for (index_ = 0; iter_.hasNext() && index_ < start; ++index_, iter_.next()) ; end_ = iter_.hasNext() ? end : index_; } // iteratorWrapper
listIterator(List<? extends T> list, int start, int end) { BoundedIterator.checkConstraints(start, end); list_ = list; index_ = start; end_ = end; if (end_ > list_.size()) end_ = list.size(); // listIterator }