package jalview.datamodel.features;
+import jalview.datamodel.ContiguousI;
import jalview.datamodel.SequenceFeature;
import jalview.io.gff.SequenceOntologyFactory;
import jalview.io.gff.SequenceOntologyI;
{
/*
* use a TreeMap so that features are returned in alphabetical order of type
- * wrap as a synchronized map for add and delete operations
+ * ? wrap as a synchronized map for add and delete operations
*/
// featureStore = Collections
// .synchronizedSortedMap(new TreeMap<String, FeatureStore>());
}
/**
+ * Constructor given a list of features
+ */
+ public SequenceFeatures(List<SequenceFeature> features)
+ {
+ this();
+ if (features != null)
+ {
+ for (SequenceFeature feature : features)
+ {
+ add(feature);
+ }
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- public boolean shiftFeatures(int shift)
+ public boolean shiftFeatures(int fromPosition, int shiftBy)
{
boolean modified = false;
for (FeatureStore fs : featureStore.values())
{
- modified |= fs.shiftFeatures(shift);
+ modified |= fs.shiftFeatures(fromPosition, shiftBy);
}
return modified;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void deleteAll()
+ {
+ featureStore.clear();
+ }
}
\ No newline at end of file