JAL-2446 find feature types for one or more groups (vararg)
[jalview.git] / src / jalview / datamodel / features / SequenceFeatures.java
index ff5f32c..ba63f69 100644 (file)
@@ -229,22 +229,27 @@ public class SequenceFeatures
 
   /**
    * Answers the set of distinct feature types for which there is at least one
-   * feature with the given feature group
+   * feature with one of the given feature group(s)
    * 
-   * @param group
+   * @param groups
    * @return
    */
-  public Set<String> getFeatureTypesForGroup(String group)
+  public Set<String> getFeatureTypesForGroups(String... groups)
   {
     Set<String> result = new HashSet<String>();
     for (Entry<String, FeatureStore> featureType : featureStore.entrySet())
     {
-      if (featureType.getValue().getFeatureGroups().contains(group))
+      Set<String> featureGroups = featureType.getValue().getFeatureGroups();
+      for (String group : groups)
       {
-        /*
-         * yes this feature type includes the query group
-         */
-        result.add(featureType.getKey());
+        if (featureGroups.contains(group))
+        {
+          /*
+           * yes this feature type includes a query group
+           */
+          result.add(featureType.getKey());
+          break;
+        }
       }
     }