Given two ordered Iterator instances A and
B, the next method on this iterator will return the
lesser of A.next() and B.next().
| Modifier and Type | Field and Description |
|---|---|
| private Comparator | comparator
The |
| private List | |
| private int | lastReturned
Index of the |
| private List | |
| private BitSet |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CollatingIterator(final Comparator<? super E>
the comparator to use to sort; must not be null,
unless you'll be invoking comp)setComparator(Comparator) later on.Constructs a new |
| public | CollatingIterator(final Comparator<? super E>
the comparator to use to sort; must not be null,
unless you'll be invoking comp, final int setComparator(Comparator) later on.the initial capacity for the internal list of
child iterators initIterCapacity)Constructs a new |
| public | CollatingIterator(final Comparator<? super E>
the comparator to use to sort; must not be null,
unless you'll be invoking comp, final Iterator<? extends E> setComparator(Comparator) later on.the first child ordered iterator a, final Iterator<? extends E> the second child ordered iterator b)Constructs a new |
| public | CollatingIterator(final Comparator<? super E>
the comparator to use to sort; must not be null,
unless you'll be invoking comp, final Iterator<? extends E>[] setComparator(Comparator) later on.the array of iterators iterators)Constructs a new |
| public | CollatingIterator(final Comparator<? super E>
the comparator to use to sort; must not be null,
unless you'll be invoking comp, final Collection<Iterator<? extends E>> setComparator(Comparator) later on.the collection of iterators iterators)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | addIterator(final Iterator<? extends E>
the iterator to add to the collation, must not be null iterator)Adds the given |
| private boolean | anyHasNext(final List<Iterator<? extends E>> iters)
Returns |
| private boolean | |
| private void | |
| private void | |
| public Comparator | |
| public int | Returns: the index of the iterator that returned the last elementReturns the index of the iterator that returned the last element. |
| public List | Returns: the unmodifiable list of iterators addedGets the list of Iterators (unmodifiable). |
| public boolean | Returns: true if this iterator has remaining elementsImplements java. true if any child iterator has remaining elements.
|
| private int | |
| public E | Returns: the next ordered elementImplements java. |
| public void | remove()
Overrides default java. |
| private boolean | |
| public void | setComparator(final Comparator<? super E>
the comp)Comparator to setSets the |
| public void | setIterator(final int
index of the Iterator to replace index, final Iterator<? extends E> Iterator to place at the given index iterator)Sets the iterator at the given index. |
| private void |
| comparator | back to summary |
|---|---|
| private Comparator<? super E> comparator The | |
| iterators | back to summary |
|---|---|
| private List<Iterator<? extends E>> iterators The list of | |
| lastReturned | back to summary |
|---|---|
| private int lastReturned Index of the | |
| values | back to summary |
|---|---|
| private List<E> values
| |
| valueSet | back to summary |
|---|---|
| private BitSet valueSet Whether or not each | |
| CollatingIterator | back to summary |
|---|---|
| public CollatingIterator() Constructs a new | |
| CollatingIterator | back to summary |
|---|---|
| public CollatingIterator(final Comparator<? super E> comp) Constructs a new
| |
| CollatingIterator | back to summary |
|---|---|
| public CollatingIterator(final Comparator<? super E> comp, final int initIterCapacity) Constructs a new
| |
| CollatingIterator | back to summary |
|---|---|
| public CollatingIterator(final Comparator<? super E> comp, final Iterator<? extends E> a, final Iterator<? extends E> b) Constructs a new
| |
| CollatingIterator | back to summary |
|---|---|
| public CollatingIterator(final Comparator<? super E> comp, final Iterator<? extends E>[] iterators) Constructs a new
| |
| CollatingIterator | back to summary |
|---|---|
| public CollatingIterator(final Comparator<? super E> comp, final Collection<Iterator<? extends E>> iterators) Constructs a new
| |
| addIterator | back to summary |
|---|---|
| public void addIterator(final Iterator<? extends E> iterator) Adds the given
| |
| anyHasNext | back to summary |
|---|---|
| private boolean anyHasNext(final List<Iterator<? extends E>> iters) Returns | |
| anyValueSet | back to summary |
|---|---|
| private boolean anyValueSet(final BitSet set) Returns | |
| checkNotStarted | back to summary |
|---|---|
| private void checkNotStarted() throws IllegalStateException Throws
| |
| clear | back to summary |
|---|---|
| private void clear(final int i) | |
| getComparator | back to summary |
|---|---|
| public Comparator Gets the
| |
| getIteratorIndex | back to summary |
|---|---|
| public int getIteratorIndex() Returns the index of the iterator that returned the last element.
| |
| getIterators | back to summary |
|---|---|
| public List Gets the list of Iterators (unmodifiable). | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Returns
| |
| least | back to summary |
|---|---|
| private int least() Returns the index of the least element in
| |
| next | back to summary |
|---|---|
| public E next() throws NoSuchElementException Implements java. Returns the next ordered element from a child iterator.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Removes the last returned element from the child iterator that produced it.
| |
| set | back to summary |
|---|---|
| private boolean set(final int i) Sets the
| |
| setComparator | back to summary |
|---|---|
| public void setComparator(final Comparator<? super E> comp) Sets the
| |
| setIterator | back to summary |
|---|---|
| public void setIterator(final int index, final Iterator<? extends E> iterator) Sets the iterator at the given index.
| |
| start | back to summary |
|---|---|
| private void start() Initializes the collating state if it hasn't been already. | |