Package org.eclipse.equinox.p2.query
Class CollectionResult<T>
java.lang.Object
org.eclipse.equinox.p2.query.CollectionResult<T>
- All Implemented Interfaces:
- Iterable<T>,- IQueryable<T>,- IQueryResult<T>
This class allows to adapt java collections to a p2 a query result and as
 such something queryable
- Since:
- 2.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisEmpty()Returns whether this QueryResult is empty.iterator()Returns an iterator on the collected objects.query(IQuery<T> query, IProgressMonitor monitor) Performs a query, passing any objects that satisfy the query to the provided collector.stream()Returns a sequentialStreamof the collected objects.T[]Returns the collected objects as an arraytoSet()Creates a new Set copy with the contents of this query result.toString()Returns a Set backed by this query result.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.equinox.p2.query.IQueryablecontainsMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
CollectionResult
 
- 
- 
Method Details- 
queryDescription copied from interface:IQueryablePerforms a query, passing any objects that satisfy the query to the provided collector.This method is long-running; progress and cancellation are provided by the given progress monitor. - Specified by:
- queryin interface- IQueryable<T>
- Parameters:
- query- The query to perform
- monitor- a progress monitor, or- nullif progress reporting is not desired
- Returns:
- The collector argument
 
- 
isEmptypublic boolean isEmpty()Description copied from interface:IQueryResultReturns whether this QueryResult is empty.- Specified by:
- isEmptyin interface- IQueryResult<T>
- Returns:
- trueif this QueryResult has accepted any results, and- falseotherwise.
 
- 
iteratorDescription copied from interface:IQueryResultReturns an iterator on the collected objects.
- 
toArrayDescription copied from interface:IQueryResultReturns the collected objects as an array- Specified by:
- toArrayin interface- IQueryResult<T>
- Parameters:
- clazz- The type of array to return
- Returns:
- The array of results
 
- 
toSetDescription copied from interface:IQueryResultCreates a new Set copy with the contents of this query result. The copy can be altered without any side effects on its origin.- Specified by:
- toSetin interface- IQueryResult<T>
- Returns:
- A detached copy of the result.
 
- 
toUnmodifiableSetDescription copied from interface:IQueryResultReturns a Set backed by this query result. The set is immutable.- Specified by:
- toUnmodifiableSetin interface- IQueryResult<T>
- Returns:
- A Set backed by this query result.
 
- 
toString
- 
streamDescription copied from interface:IQueryResultReturns a sequentialStreamof the collected objects.- Specified by:
- streamin interface- IQueryResult<T>
 
 
-