| java.lang.Object uk.co.jezuk.mango.iterators.BoundedIterator
BoundedIterator | public class BoundedIterator implements java.util.Iterator(Code) | | A BoundedIterator enumerates of a subset of a collection, in the
range [start , end ). A normal java.util.Iterator
traverses [0, collection.size()), so BoundedIterator allows you
to pick out a sub-set without using list.subList()
or equivalent.
author: Jez Higgins, jez@jezuk.co.uk version: $Id: BoundedIterator.java 49 2002-06-11 14:43:09Z jez $ |
Constructor Summary | |
public | BoundedIterator(java.util.Iterator iterator, int start, int end) This form of BoundedIterator limits the range traversed by the
underlying iterator . | public | BoundedIterator(java.util.List list, int start, int end) The form of BoundedIterator uses indexed access directly into
the list.
If end > list.end() the travesal will stop with
list.end() is reached.
For ArrayLists and Vectors it
should be slightly quicker. |
BoundedIterator | public BoundedIterator(java.util.Iterator iterator, int start, int end)(Code) | | This form of BoundedIterator limits the range traversed by the
underlying iterator .
If iterator.hasNext() fails before end is
reached, the traversal will stop prematurely.
throws: java.lang.IndexOutOfBoundsException - if start<0, end<0 or start>end |
BoundedIterator | public BoundedIterator(java.util.List list, int start, int end)(Code) | | The form of BoundedIterator uses indexed access directly into
the list.
If end > list.end() the travesal will stop with
list.end() is reached.
For ArrayLists and Vectors it
should be slightly quicker. For LinkedLists it
will be slower.
throws: java.lang.IndexOutOfBoundsException - if start<0, end<0 or start>end |
hasNext | public boolean hasNext()(Code) | | |
remove | public void remove()(Code) | | |
|
|