+
+ /**
+ * {@inheritDoc} This method is 'semi-optimised': it only inspects features
+ * for types that include the specified group, but has to inspect every
+ * feature of those types for matching feature group. This is efficient unless
+ * a sequence has features that share the same type but are in different
+ * groups - an unlikely case.
+ * <p>
+ * For example, if RESNUM feature is created with group = PDBID, then features
+ * would only be retrieved for those sequences associated with the target
+ * PDBID (group).
+ */
+ @Override
+ public List<SequenceFeature> getFeaturesForGroup(boolean positional,
+ String group, String... type)
+ {
+ List<SequenceFeature> result = new ArrayList<SequenceFeature>();
+ Iterable<String> types = varargToTypes(type);
+
+ for (String featureType : types)
+ {
+ /*
+ * check whether the feature type is present, and also
+ * whether it has features for the specified group
+ */
+ FeatureStore features = featureStore.get(featureType);
+ if (features != null
+ && features.getFeatureGroups(positional).contains(group))
+ {
+ result.addAll(features.getFeaturesForGroup(positional, group));
+ }
+ }
+ return result;
+ }