| java.lang.Object org.apache.commons.collections.iterators.CollatingIterator
CollatingIterator | public class CollatingIterator implements Iterator(Code) | | Provides an ordered iteration over the elements contained in
a collection of ordered Iterators.
Given two ordered
Iterator instances A and B ,
the
CollatingIterator.next method on this iterator will return the lesser of
A.next() and B.next() .
since: Commons Collections 2.1 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: Rodney Waldhoff author: Stephen Colebourne |
Constructor Summary | |
public | CollatingIterator() Constructs a new CollatingIterator . | public | CollatingIterator(Comparator comp) Constructs a new CollatingIterator that will used the
specified comparator for ordering. | public | CollatingIterator(Comparator comp, int initIterCapacity) Constructs a new CollatingIterator that will used the
specified comparator for ordering and have the specified initial
capacity. | public | CollatingIterator(Comparator comp, Iterator a, Iterator b) Constructs a new CollatingIterator that will use the
specified comparator to provide ordered iteration over the two
given iterators. | public | CollatingIterator(Comparator comp, Iterator[] iterators) Constructs a new CollatingIterator that will use the
specified comparator to provide ordered iteration over the array
of iterators. | public | CollatingIterator(Comparator comp, Collection iterators) Constructs a new CollatingIterator that will use the
specified comparator to provide ordered iteration over the collection
of iterators. |
CollatingIterator | public CollatingIterator()(Code) | | Constructs a new CollatingIterator . Natural sort order
will be used, and child iterators will have to be manually added
using the
CollatingIterator.addIterator(Iterator) method.
|
CollatingIterator | public CollatingIterator(Comparator comp)(Code) | | Constructs a new CollatingIterator that will used the
specified comparator for ordering. Child iterators will have to be
manually added using the
CollatingIterator.addIterator(Iterator) method.
Parameters: comp - the comparator to use to sort, or null to use natural sort order |
CollatingIterator | public CollatingIterator(Comparator comp, int initIterCapacity)(Code) | | Constructs a new CollatingIterator that will used the
specified comparator for ordering and have the specified initial
capacity. Child iterators will have to be
manually added using the
CollatingIterator.addIterator(Iterator) method.
Parameters: comp - the comparator to use to sort, or null to use natural sort order Parameters: initIterCapacity - the initial capacity for the internal listof child iterators |
CollatingIterator | public CollatingIterator(Comparator comp, Iterator a, Iterator b)(Code) | | Constructs a new CollatingIterator that will use the
specified comparator to provide ordered iteration over the two
given iterators.
Parameters: comp - the comparator to use to sort, or null to use natural sort order Parameters: a - the first child ordered iterator Parameters: b - the second child ordered iterator throws: NullPointerException - if either iterator is null |
CollatingIterator | public CollatingIterator(Comparator comp, Iterator[] iterators)(Code) | | Constructs a new CollatingIterator that will use the
specified comparator to provide ordered iteration over the array
of iterators.
Parameters: comp - the comparator to use to sort, or null to use natural sort order Parameters: iterators - the array of iterators throws: NullPointerException - if iterators array is or contains null |
CollatingIterator | public CollatingIterator(Comparator comp, Collection iterators)(Code) | | Constructs a new CollatingIterator that will use the
specified comparator to provide ordered iteration over the collection
of iterators.
Parameters: comp - the comparator to use to sort, or null to use natural sort order Parameters: iterators - the collection of iterators throws: NullPointerException - if the iterators collection is or contains null throws: ClassCastException - if the iterators collection contains anelement that's not an Iterator |
getIterators | public List getIterators()(Code) | | Gets the list of Iterators (unmodifiable).
the unmodifiable list of iterators added |
hasNext | public boolean hasNext()(Code) | | Returns true if any child iterator has remaining elements.
true if this iterator has remaining elements |
remove | public void remove()(Code) | | Removes the last returned element from the child iterator that
produced it.
throws: IllegalStateException - if there is no last returned element,or if the last returned element has already been removed |
|
|