JAL-2808 refactor KeyedMatcher as FeatureMatcher with byLabel, byScore, byAttribute...
[jalview.git] / src / jalview / datamodel / features / FeatureMatcherSetI.java
@@ -1,24 +1,23 @@
-package jalview.util.matcher;
+package jalview.datamodel.features;
 
-import java.util.function.Function;
+import jalview.datamodel.SequenceFeature;
 
 /**
- * An interface to describe a set of one or more key-value match conditions,
- * where all conditions are combined with either AND or OR
+ * An interface to describe a set of one or more feature matchers, where all
+ * matchers are combined with either AND or OR
  * 
  * @author gmcarstairs
  *
  */
-public interface KeyedMatcherSetI
+public interface FeatureMatcherSetI
 {
   /**
-   * Answers true if the value provided for this matcher's key passes this
-   * matcher's match condition
+   * Answers true if the feature provided passes this matcher's match condition
    * 
-   * @param valueProvider
+   * @param feature
    * @return
    */
-  boolean matches(Function<String[], String> valueProvider);
+  boolean matches(SequenceFeature feature);
 
   /**
    * Answers a new object that matches the logical AND of this and m
@@ -28,7 +27,7 @@ public interface KeyedMatcherSetI
    * @throws IllegalStateException
    *           if an attempt is made to AND to existing OR-ed conditions
    */
-  KeyedMatcherSetI and(KeyedMatcherI m);
+  FeatureMatcherSetI and(FeatureMatcherI m);
 
   /**
    * Answers true if any second condition is AND-ed with this one, false if it
@@ -46,14 +45,14 @@ public interface KeyedMatcherSetI
    * @throws IllegalStateException
    *           if an attempt is made to OR to existing AND-ed conditions
    */
-  KeyedMatcherSetI or(KeyedMatcherI m);
+  FeatureMatcherSetI or(FeatureMatcherI m);
 
   /**
    * Answers an iterator over the combined match conditions
    * 
    * @return
    */
-  Iterable<KeyedMatcherI> getMatchers();
+  Iterable<FeatureMatcherI> getMatchers();
 
   /**
    * Answers true if this object contains no conditions