public abstract class AbstractQuery<Result> extends java.lang.Object implements Query<Result>
Constructor and Description |
---|
AbstractQuery() |
Modifier and Type | Method and Description |
---|---|
Query<Result> |
allowParallelProcessing() |
protected static <T> boolean |
delegateProcessResults(Query<T> query,
Processor<? super T> consumer)
Should be called only from
processResults(com.intellij.util.Processor<? super Result>) implementations to delegate to another query |
java.util.Collection<Result> |
findAll()
Get all of the results in the
Collection |
Result |
findFirst()
Get the first result or
null if no results have been found. |
boolean |
forEach(Processor<? super Result> consumer)
Process search results one-by-one.
|
AsyncFuture<java.lang.Boolean> |
forEachAsync(Processor<? super Result> consumer) |
java.util.Iterator<Result> |
iterator() |
protected abstract boolean |
processResults(Processor<? super Result> consumer)
Assumes consumer being capable of processing results in parallel
|
Result [] |
toArray(Result [] a) |
static <T> Query<T> |
wrapInReadAction(Query<? extends T> query) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.util.Collection<Result> findAll()
Query
Collection
public java.util.Iterator<Result> iterator()
iterator
in interface java.lang.Iterable<Result>
public Result findFirst()
Query
null
if no results have been found.public Query<Result> allowParallelProcessing()
allowParallelProcessing
in interface Query<Result>
Query.forEach(com.intellij.util.Processor<? super Result>)
accepts non-thread-safe consumers, so it may call the consumer in parallel.public boolean forEach(Processor<? super Result> consumer)
Query
consumer
passed.
The consumer might be called on different threads, but by default these calls are mutually exclusive, so no additional
synchronization inside consumer is necessary. If you need to process results in parallel, run forEach()
on
the result of Query.allowParallelProcessing()
.public AsyncFuture<java.lang.Boolean> forEachAsync(Processor<? super Result> consumer)
forEachAsync
in interface Query<Result>
protected abstract boolean processResults(Processor<? super Result> consumer)
protected static <T> boolean delegateProcessResults(Query<T> query, Processor<? super T> consumer)
processResults(com.intellij.util.Processor<? super Result>)
implementations to delegate to another query