JAL-2505 JAL-2542 SequenceFeatures.shift() to shift all positional
[jalview.git] / src / jalview / datamodel / features / SequenceFeatures.java
index 34470cc..f263938 100644 (file)
@@ -220,9 +220,11 @@ public class SequenceFeatures implements SequenceFeaturesI
     /*
      * else make a copy of the list, and remove any null value just in case,
      * as it would cause errors looking up the features Map
+     * sort in alphabetical order for consistent output behaviour
      */
     List<String> types = new ArrayList<String>(Arrays.asList(type));
     types.remove(null);
+    Collections.sort(types);
     return types;
   }
 
@@ -459,4 +461,18 @@ public class SequenceFeatures implements SequenceFeaturesI
     }
     return result;
   }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean shiftFeatures(int shift)
+  {
+    boolean modified = false;
+    for (FeatureStore fs : featureStore.values())
+    {
+      modified |= fs.shiftFeatures(shift);
+    }
+    return modified;
+  }
 }
\ No newline at end of file