Package net.sf.basedb.util.query
Class MultiQueryIterator<E extends BasicItem>
- java.lang.Object
-
- net.sf.basedb.util.query.MultiQueryIterator<E>
-
- All Implemented Interfaces:
Iterator<E>
public class MultiQueryIterator<E extends BasicItem> extends Object implements Iterator<E>
Helper class for executing multiple queries and return the result as a single iterator. The queries are executed in the order that they are given, if a query doesn't return any result, the iterator continues with the next query. As soon as a query returns at least one result, no more queries are executed.- Since:
- 3.2
- Author:
- nicklas
-
-
Constructor Summary
Constructors Modifier Constructor Description private
MultiQueryIterator(DbControl dc, ItemQuery<? extends E>[] queries)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E extends BasicItem>
Iterator<E>get(DbControl dc, ItemQuery<? extends E>... queries)
Create a new iterator for the given list of queries.boolean
hasNext()
E
next()
void
remove()
-
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
-
-
-
-
Method Detail
-
get
@SafeVarargs public static <E extends BasicItem> Iterator<E> get(DbControl dc, ItemQuery<? extends E>... queries)
Create a new iterator for the given list of queries. There must be at least one query.- Parameters:
dc
- The DbControl to use when executing the queriesqueries
- An array of queries to execute
-
-