fix many methods reported as unused: in the optimized search world the first of the two merged queries may be satisfied only when the second one is running. Unfortunately

This commit is contained in:
peter
2010-07-29 14:18:20 +01:00
parent 250a89acb5
commit 12fa9480e9
@@ -38,15 +38,14 @@ public class MergeQuery<T> implements Query<T>{
@NotNull
public Collection<T> findAll() {
List<T> results = new ArrayList<T>();
results.addAll(myQuery1.findAll());
results.addAll(myQuery2.findAll());
forEach(new CommonProcessors.CollectProcessor<T>(results));
return results;
}
public T findFirst() {
final T r1 = myQuery1.findFirst();
if (r1 != null) return r1;
return myQuery2.findFirst();
final CommonProcessors.FindFirstProcessor<T> processor = new CommonProcessors.FindFirstProcessor<T>();
forEach(processor);
return processor.getFoundValue();
}
public boolean forEach(@NotNull final Processor<T> consumer) {