Package com.intellij.util
Interface Query<Result>
-
- All Superinterfaces:
Iterable<Result>
- All Known Implementing Classes:
ArrayQuery
,CollectionQuery
,EmptyQuery
,LazyQuery
,MergeQuery
public interface Query<Result> extends Iterable<Result>
- Author:
- max
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<Result>
findAll()
Get all of the results in theCollection
Result
findFirst()
Get the first result ornull
if no results have been found.boolean
forEach(Processor<Result> consumer)
Process search results one-by-one.Result[]
toArray(Result[] a)
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
findAll
@NotNull Collection<Result> findAll()
Get all of the results in theCollection
- Returns:
- results in a collection or empty collection if no results found.
-
findFirst
@Nullable Result findFirst()
Get the first result ornull
if no results have been found.- Returns:
- first result of the search or
null
if no results.
-
forEach
boolean forEach(@NotNull Processor<Result> consumer)
Process search results one-by-one. All the results will be subsequently fed to aconsumer
passed.- Parameters:
consumer
- - a processor search results should be fed to.- Returns:
true
if the search was completed normally,false
if the occurrence processing was cancelled by the processor.
-
-