Package net.sf.basedb.util
Class NestedIterator<E>
- java.lang.Object
-
- net.sf.basedb.util.NestedIterator<E>
-
- All Implemented Interfaces:
Iterator<E>
public class NestedIterator<E> extends Object implements Iterator<E>
This class implements theIterator
interface for iterating multiple collections as if it was one big collection.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2015-05-20 14:43:14 +0200 (on, 20 maj 2015) $
-
-
Field Summary
Fields Modifier and Type Field Description private Collection<? extends E>[]
collections
The array to iterate.private Iterator<? extends E>
current
The current iterator.private int
index
The index of the next collection to return.
-
Constructor Summary
Constructors Constructor Description NestedIterator(Collection<? extends E>... collections)
Create a newArrayIterator
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
E
next()
void
remove()
This operation is not supported.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
collections
private final Collection<? extends E>[] collections
The array to iterate.
-
index
private int index
The index of the next collection to return.
-
-
Constructor Detail
-
NestedIterator
@SafeVarargs public NestedIterator(Collection<? extends E>... collections)
Create a newArrayIterator
object.- Parameters:
collections
- An array of Collection objects.
-
-
Method Detail
-
remove
public void remove()
This operation is not supported.- Specified by:
remove
in interfaceIterator<E>
- Throws:
UnsupportedOperationException
- Is always thrown
-
-