Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoribull2009-12-16 17:13:18 +0000
committeribull2009-12-16 17:13:18 +0000
commit9eb517cb0ed014947a0e9bbecad10fe3cba7b2b7 (patch)
treeb5ddc33c7e52c21ea62746fb4fdf0499bbdcdf9e
parentd2157b66583032d36bddbe5b87bf351f7b5829cc (diff)
downloadrt.equinox.p2-9eb517cb0ed014947a0e9bbecad10fe3cba7b2b7.tar.gz
rt.equinox.p2-9eb517cb0ed014947a0e9bbecad10fe3cba7b2b7.tar.xz
rt.equinox.p2-9eb517cb0ed014947a0e9bbecad10fe3cba7b2b7.zip
256411: Use an Iterator in favor of a Collector in the IQueryable interface
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256411 Removed the acceptor. It wasn't really needed and it just confused the API.
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java33
2 files changed, 3 insertions, 35 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java
index ef622876e..e8ca53c40 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java
@@ -16,7 +16,8 @@ import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.Messages;
-import org.eclipse.equinox.p2.metadata.query.*;
+import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* A collector is a generic visitor that collects objects passed to it,
@@ -27,7 +28,7 @@ import org.eclipse.equinox.p2.metadata.query.*;
* This default collector just accepts all objects passed to it. Clients may subclass
* to perform different processing on the objects passed to it.
*/
-public class Collector implements IQueryResult, IAcceptor {
+public class Collector implements IQueryResult {
private Set collected = null;
/**
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java
deleted file mode 100644
index 143e1be29..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 EclipseSource and others. All rights reserved. This
-* program and the accompanying materials are made available under the terms of
-* the Eclipse Public License v1.0 which accompanies this distribution, and is
-* available at http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* EclipseSource - initial API and implementation
-******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-/**
- * An IAcceptor processes objects that satisfy a query.
- *
- * @since 2.0
- *
- */
-public interface IAcceptor {
-
- /**
- * Accepts an object.
- * <p>
- * This default implementation adds the objects to a list. Clients may
- * override this method to perform additional filtering, add different objects
- * to the list, short-circuit the traversal, or process the objects directly without
- * collecting them.
- *
- * @param object the object to collect or visit
- * @return <code>true</code> if the traversal should continue,
- * or <code>false</code> to indicate the traversal should stop.
- */
- public boolean accept(Object object);
-}

Back to the top