JAL-1858 handle hidden columns when computing region to redraw
[jalview.git] / src / jalview / datamodel / SearchResults.java
index 8d98fc4..8ed47dc 100755 (executable)
@@ -34,7 +34,7 @@ import java.util.List;
 public class SearchResults implements SearchResultsI
 {
 
-  private List<SearchResultMatchI> matches = new ArrayList<SearchResultMatchI>();
+  private List<SearchResultMatchI> matches = new ArrayList<>();
 
   /**
    * One match consists of a sequence reference, start and end positions.
@@ -42,17 +42,17 @@ public class SearchResults implements SearchResultsI
    */
   public class Match implements SearchResultMatchI
   {
-    SequenceI sequence;
+    final SequenceI sequence;
 
     /**
      * Start position of match in sequence (base 1)
      */
-    int start;
+    final int start;
 
     /**
      * End position (inclusive) (base 1)
      */
-    int end;
+    final int end;
 
     /**
      * create a Match on a range of sequence. Match always holds region in
@@ -133,11 +133,6 @@ public class SearchResults implements SearchResultsI
       return sb.toString();
     }
 
-    public void setSequence(SequenceI seq)
-    {
-      this.sequence = seq;
-    }
-
     /**
      * Hashcode is the hashcode of the matched sequence plus a hash of start and
      * end positions. Match objects that pass the test for equals are guaranteed
@@ -358,4 +353,10 @@ public class SearchResults implements SearchResultsI
     SearchResultsI sr = (SearchResultsI) obj;
     return matches.equals(sr.getResults());
   }
+
+  @Override
+  public void addSearchResults(SearchResultsI toAdd)
+  {
+    matches.addAll(toAdd.getResults());
+  }
 }