Package org.eclipse.equinox.p2.query
Interface IQueryResult<T>
- All Superinterfaces:
IQueryable<T>,Iterable<T>
- All Known Implementing Classes:
CollectionResult,Collector
An IQueryResult represents the results of a query.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()Returns whether this QueryResult is empty.iterator()Returns an iterator on the collected objects.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.Returns a Set backed by this query result.Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable
contains, queryMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
isEmpty
boolean isEmpty()Returns whether this QueryResult is empty.- Returns:
trueif this QueryResult has accepted any results, andfalseotherwise.
-
iterator
Returns an iterator on the collected objects. -
toArray
Returns the collected objects as an array- Parameters:
clazz- The type of array to return- Returns:
- The array of results
- Throws:
ArrayStoreException- the runtime type of the specified array is not a super-type of the runtime type of every collected object
-
toSet
Creates a new Set copy with the contents of this query result. The copy can be altered without any side effects on its origin.- Returns:
- A detached copy of the result.
-
toUnmodifiableSet
Returns a Set backed by this query result. The set is immutable.- Returns:
- A Set backed by this query result.
-
stream
Returns a sequentialStreamof the collected objects.- Since:
- 2.8
- Implementation Requirements:
- The default implementation creates a sequential
Streamfrom this query-resultsSpliterator. Implementations backed by aCollectionshould override this method and callCollection.stream().
-