Merge branch 'develop' into features/JAL-2446NCList
[jalview.git] / src / jalview / datamodel / features / NCList.java
index 0af9d50..a6a23e7 100644 (file)
@@ -1,8 +1,10 @@
 package jalview.datamodel.features;
 
+import jalview.datamodel.ContiguousI;
+import jalview.datamodel.Range;
+
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
 /**
@@ -28,12 +30,6 @@ public class NCList<T extends ContiguousI>
    */
   private List<NCNode<T>> subranges;
 
-  /*
-   * a comparator to sort intervals by start position ascending, with
-   * longer (enclosing) intervals preceding those they enclose 
-   */
-  Comparator<ContiguousI> intervalSorter = new RangeComparator(true);
-
   /**
    * Constructor given a list of things that are each located on a contiguous
    * interval. Note that the constructor may reorder the list.
@@ -61,7 +57,7 @@ public class NCList<T extends ContiguousI>
      * sort by start ascending so that contained intervals 
      * follow their containing interval
      */
-    Collections.sort(ranges, intervalSorter);
+    Collections.sort(ranges, RangeComparator.BY_START_POSITION);
 
     List<Range> sublists = buildSubranges(ranges);
 
@@ -610,7 +606,7 @@ public class NCList<T extends ContiguousI>
         if (subRegions != null)
         {
           subranges.addAll(subRegions.subranges);
-          Collections.sort(subranges, intervalSorter);
+          Collections.sort(subranges, RangeComparator.BY_START_POSITION);
         }
         size--;
         return true;