/** * Construct an IteratorChain with a single Iterator. * * @param iterator first Iterator in the IteratorChain * @throws NullPointerException if the iterator is null */ public IteratorChain(Iterator iterator) { super(); addIterator(iterator); }
/** * Constructs a new <code>IteratorChain</code> over the two * given iterators. * * @param a the first child iterator * @param b the second child iterator * @throws NullPointerException if either iterator is null */ public IteratorChain(Iterator a, Iterator b) { super(); addIterator(a); addIterator(b); }
/** * Constructs a new <code>IteratorChain</code> over the array * of iterators. * * @param iterators the array of iterators * @throws NullPointerException if iterators array is or contains null */ public IteratorChain(Iterator[] iterators) { super(); for (int i = 0; i < iterators.length; i++) { addIterator(iterators[i]); } }
/** * Construct an IteratorChain with a single Iterator. * * @param iterator first Iterator in the IteratorChain * @throws NullPointerException if the iterator is null */ public IteratorChain(Iterator iterator) { super(); addIterator(iterator); }
/** * Constructs a new <code>IteratorChain</code> over the two * given iterators. * * @param a the first child iterator * @param b the second child iterator * @throws NullPointerException if either iterator is null */ public IteratorChain(Iterator a, Iterator b) { super(); addIterator(a); addIterator(b); }
/** * Constructs a new <code>IteratorChain</code> over the array * of iterators. * * @param iterators the array of iterators * @throws NullPointerException if iterators array is or contains null */ public IteratorChain(Iterator[] iterators) { super(); for (int i = 0; i < iterators.length; i++) { addIterator(iterators[i]); } }
/** * Constructs a new <code>IteratorChain</code> over the collection * of iterators. * * @param iterators the collection of iterators * @throws NullPointerException if iterators collection is or contains null * @throws ClassCastException if iterators collection doesn't contain an iterator */ public IteratorChain(Collection iterators) { super(); for (Iterator it = iterators.iterator(); it.hasNext();) { Iterator item = (Iterator) it.next(); addIterator(item); } }
/** * Constructs a new <code>IteratorChain</code> over the collection * of iterators. * * @param iterators the collection of iterators * @throws NullPointerException if iterators collection is or contains null * @throws ClassCastException if iterators collection doesn't contain an iterator */ public IteratorChain(Collection iterators) { super(); for (Iterator it = iterators.iterator(); it.hasNext();) { Iterator item = (Iterator) it.next(); addIterator(item); } }
/** * Gets an iterator over all the collections in this composite. * <p> * This implementation uses an <code>IteratorChain</code>. * * @return an <code>IteratorChain</code> instance which supports * <code>remove()</code>. Iteration occurs over contained collections in * the order they were added, but this behavior should not be relied upon. * @see IteratorChain */ public Iterator iterator() { if (this.all.length == 0) { return EmptyIterator.INSTANCE; } IteratorChain chain = new IteratorChain(); for (int i = 0; i < this.all.length; ++i) { chain.addIterator(this.all[i].iterator()); } return chain; }
/** * Gets an iterator over all the collections in this composite. * <p> * This implementation uses an <code>IteratorChain</code>. * * @return an <code>IteratorChain</code> instance which supports * <code>remove()</code>. Iteration occurs over contained collections in * the order they were added, but this behavior should not be relied upon. * @see IteratorChain */ public Iterator iterator() { if (this.all.length == 0) { return EmptyIterator.INSTANCE; } IteratorChain chain = new IteratorChain(); for (int i = 0; i < this.all.length; ++i) { chain.addIterator(this.all[i].iterator()); } return chain; }
public Iterator iterator() { final IteratorChain chain = new IteratorChain(); for (Iterator it = keySet().iterator(); it.hasNext();) { chain.addIterator(new ValuesIterator(it.next())); } return chain; }
public Iterator makeFullIterator() { IteratorChain chain = new IteratorChain(); chain.addIterator(list1.iterator()); chain.addIterator(list2.iterator()); chain.addIterator(list3.iterator()); return chain; }
public Iterator iterator() { final IteratorChain chain = new IteratorChain(); for (Iterator it = keySet().iterator(); it.hasNext();) { chain.addIterator(new ValuesIterator(it.next())); } return chain; }
public void testFirstIteratorIsEmptyBug() { List empty = new ArrayList(); List notEmpty = new ArrayList(); notEmpty.add("A"); notEmpty.add("B"); notEmpty.add("C"); IteratorChain chain = new IteratorChain(); chain.addIterator(empty.iterator()); chain.addIterator(notEmpty.iterator()); assertTrue("should have next",chain.hasNext()); assertEquals("A",chain.next()); assertTrue("should have next",chain.hasNext()); assertEquals("B",chain.next()); assertTrue("should have next",chain.hasNext()); assertEquals("C",chain.next()); assertTrue("should not have next",!chain.hasNext()); }
/** * Construct an IteratorChain with a single Iterator. * * @param iterator first Iterator in the IteratorChain * @throws NullPointerException if the iterator is null */ public IteratorChain(Iterator iterator) { super(); addIterator(iterator); }
/** * Construct an IteratorChain with a single Iterator. * * @param iterator first Iterator in the IteratorChain * @throws NullPointerException if the iterator is null */ public IteratorChain(Iterator iterator) { super(); addIterator(iterator); }
public EntryIterator(int type) { _type = type; _itr.addIterator(new FilterIterator(getView(pinnedMap), this)); _itr.addIterator(getView(cacheMap)); _itr.addIterator(getView(softMap)); }
public EntryIterator(int type) { _type = type; _itr.addIterator(new FilterIterator(getView(pinnedMap), this)); _itr.addIterator(getView(cacheMap)); _itr.addIterator(getView(softMap)); }
private Itr iterator(int mode) { _iterated = true; // have to copy the entry set of _map to prevent concurrent mod errors IteratorChain chain = new IteratorChain(); if (_map != null) chain.addIterator(new ArrayList(_map.entrySet()).iterator()); chain.addIterator(new FilterIterator(itr(), this)); return new Itr(mode, chain); }
public Iterator iterator() { _iterated = true; IteratorChain chain = new IteratorChain(); chain.addIterator(new FilterIterator(itr(), this)); // note have to copy _ct.getAdded to prevent concurrent mod errors chain.addIterator(new ArrayList(_ct.getAdded()).iterator()); return new Itr(chain); }