JAL-2480 tidy generic initialisations, SequenceFeatures.varargToTypes
[jalview.git] / src / jalview / datamodel / features / FeatureStore.java
index 332e9ec..84e7736 100644 (file)
@@ -1,5 +1,6 @@
 package jalview.datamodel.features;
 
+import jalview.datamodel.ContiguousI;
 import jalview.datamodel.SequenceFeature;
 
 import java.util.ArrayList;
@@ -280,7 +281,7 @@ public class FeatureStore
   {
     if (nestedFeatures == null)
     {
-      nestedFeatures = new NCList<SequenceFeature>(feature);
+      nestedFeatures = new NCList<>(feature);
       return true;
     }
     return nestedFeatures.add(feature, false);
@@ -454,7 +455,7 @@ public class FeatureStore
    */
   public List<SequenceFeature> findOverlappingFeatures(long start, long end)
   {
-    List<SequenceFeature> result = new ArrayList<SequenceFeature>();
+    List<SequenceFeature> result = new ArrayList<>();
 
     findNonNestedFeatures(start, end, result);
 
@@ -632,7 +633,7 @@ public class FeatureStore
     /*
      * add non-nested features (may be all features for many cases)
      */
-    List<SequenceFeature> result = new ArrayList<SequenceFeature>();
+    List<SequenceFeature> result = new ArrayList<>();
     result.addAll(nonNestedFeatures);
 
     /*
@@ -666,7 +667,7 @@ public class FeatureStore
     {
       return Collections.emptyList();
     }
-    return new ArrayList<SequenceFeature>(contactFeatureStarts);
+    return new ArrayList<>(contactFeatureStarts);
   }
 
   /**
@@ -681,7 +682,7 @@ public class FeatureStore
     {
       return Collections.emptyList();
     }
-    return new ArrayList<SequenceFeature>(nonPositionalFeatures);
+    return new ArrayList<>(nonPositionalFeatures);
   }
 
   /**
@@ -819,27 +820,6 @@ public class FeatureStore
   }
 
   /**
-   * Scans all positional features to check whether the given feature group is
-   * found, and returns true if found, else false
-   * 
-   * @param featureGroup
-   * @return
-   */
-  protected boolean findFeatureGroup(String featureGroup)
-  {
-    for (SequenceFeature sf : getPositionalFeatures())
-    {
-      String group = sf.getFeatureGroup();
-      if (group == featureGroup
-              || (group != null && group.equals(featureGroup)))
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
    * Answers true if this store has no features, else false
    * 
    * @return
@@ -992,7 +972,7 @@ public class FeatureStore
   public List<SequenceFeature> getFeaturesForGroup(boolean positional,
           String group)
   {
-    List<SequenceFeature> result = new ArrayList<SequenceFeature>();
+    List<SequenceFeature> result = new ArrayList<>();
 
     /*
      * if we know features don't include the target group, no need