public class CollectionResult<T> extends Object implements IQueryResult<T>
Constructor and Description |
---|
CollectionResult(Collection<T> collection) |
Modifier and Type | Method and Description |
---|---|
boolean |
isEmpty()
Returns whether this QueryResult is empty.
|
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(Class<T> clazz)
Returns the collected objects as an array
|
Set<T> |
toSet()
Creates a new Set copy with the contents of this query result.
|
String |
toString() |
Set<T> |
toUnmodifiableSet()
Returns a Set backed by this query result.
|
public CollectionResult(Collection<T> collection)
public IQueryResult<T> query(IQuery<T> query, IProgressMonitor monitor)
IQueryable
This 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 boolean isEmpty()
IQueryResult
isEmpty
in interface IQueryResult<T>
true
if this QueryResult has accepted any results,
and false
otherwise.public Iterator<T> iterator()
IQueryResult
public T[] toArray(Class<T> clazz)
IQueryResult
toArray
in interface IQueryResult<T>
clazz
- The type of array to returnpublic Set<T> toSet()
IQueryResult
toSet
in interface IQueryResult<T>
public Set<T> toUnmodifiableSet()
IQueryResult
toUnmodifiableSet
in interface IQueryResult<T>
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.