public class QueryResult<T> extends java.lang.Object implements IQueryResult<T>
| Constructor and Description |
|---|
QueryResult(java.util.Collection<T> collection) |
QueryResult(java.util.Iterator<T> iterator)
Create an QueryResult based on the given iterator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEmpty()
Returns whether this QueryResult is empty.
|
java.util.Iterator<T> |
iterator()
Returns an iterator on the collected objects.
|
IQueryResult<T> |
query(IQuery<T> query,
IProgressMonitor monitor)
Performs a query, passing any objects that satisfy the
query to the provided collector.
|
T[] |
toArray(java.lang.Class<T> clazz)
Returns the collected objects as an array
|
java.util.Set<T> |
toSet()
Creates a new Set copy with the contents of this query result.
|
java.util.Set<T> |
toUnmodifiableSet()
Returns a Set backed by this query result.
|
public QueryResult(java.util.Iterator<T> iterator)
oneShot parameter
can be set to true if the returned instance is expected to be perused
only once. This will allow some optimizations since the result of the iteration doesn't
need to be copied in preparation for a second iteration.iterator - The iterator to use as the result iterator.public QueryResult(java.util.Collection<T> collection)
public boolean isEmpty()
IQueryResultisEmpty in interface IQueryResult<T>true if this QueryResult has accepted any results,
and false otherwise.public java.util.Iterator<T> iterator()
IQueryResultiterator in interface java.lang.Iterable<T>iterator in interface IQueryResult<T>public T[] toArray(java.lang.Class<T> clazz)
IQueryResulttoArray in interface IQueryResult<T>clazz - The type of array to returnpublic java.util.Set<T> toSet()
IQueryResulttoSet in interface IQueryResult<T>public IQueryResult<T> query(IQuery<T> query, IProgressMonitor monitor)
IQueryableThis method is long-running; progress and cancellation are provided by the given progress monitor.
query in interface IQueryable<T>query - The query to performmonitor - a progress monitor, or null if progress
reporting is not desiredpublic java.util.Set<T> toUnmodifiableSet()
IQueryResulttoUnmodifiableSet in interface IQueryResult<T>