Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
    }