+ * {@inheritDoc}
+ */
+ @Override
+ public List<SequenceFeature> findFeatures(int from, int to,
+ String... type)
+ {
+ List<SequenceFeature> result = new ArrayList<>();
+
+ for (FeatureStore featureSet : varargToTypes(type))
+ {
+ result.addAll(featureSet.findOverlappingFeatures(from, to));
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<SequenceFeature> getAllFeatures(String... type)
+ {
+ List<SequenceFeature> result = new ArrayList<>();
+
+ result.addAll(getPositionalFeatures(type));
+
+ result.addAll(getNonPositionalFeatures());
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<SequenceFeature> getFeaturesByOntology(String... ontologyTerm)
+ {
+ if (ontologyTerm == null || ontologyTerm.length == 0)
+ {
+ return new ArrayList<>();
+ }
+
+ Set<String> featureTypes = getFeatureTypes(ontologyTerm);
+ if (featureTypes.isEmpty())
+ {
+ /*
+ * no features of the specified type or any sub-type
+ */
+ return new ArrayList<>();
+ }
+
+ return getAllFeatures(featureTypes.toArray(new String[featureTypes
+ .size()]));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getFeatureCount(boolean positional, String... type)
+ {
+ int result = 0;
+
+ for (FeatureStore featureSet : varargToTypes(type))
+ {
+ result += featureSet.getFeatureCount(positional);
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getTotalFeatureLength(String... type)
+ {
+ int result = 0;
+
+ for (FeatureStore featureSet : varargToTypes(type))
+ {
+ result += featureSet.getTotalFeatureLength();
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<SequenceFeature> getPositionalFeatures(String... type)
+ {
+ List<SequenceFeature> result = new ArrayList<>();
+
+ for (FeatureStore featureSet : varargToTypes(type))
+ {
+ result.addAll(featureSet.getPositionalFeatures());
+ }
+ return result;
+ }
+
+ /**
+ * A convenience method that converts a vararg for feature types to an
+ * Iterable over matched feature sets. If no types are specified, all feature
+ * sets are returned. If one or more types are specified, feature sets for
+ * those types are returned, preserving the order of the types.