git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'doc/JAL-4090_Release_2_11_3_0' into develop
[jalview.git]
/
src
/
jalview
/
datamodel
/
SearchResults.java
diff --git
a/src/jalview/datamodel/SearchResults.java
b/src/jalview/datamodel/SearchResults.java
index
9daa752
..
546dd6f
100755
(executable)
--- a/
src/jalview/datamodel/SearchResults.java
+++ b/
src/jalview/datamodel/SearchResults.java
@@
-23,8
+23,6
@@
package jalview.datamodel;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
/**
* Holds a list of search result matches, where each match is a contiguous
/**
* Holds a list of search result matches, where each match is a contiguous
@@
-37,7
+35,7
@@
public class SearchResults implements SearchResultsI
{
private int count;
{
private int count;
- private SortedSet<SearchResultMatchI> matches = new TreeSet<>();
+ private ArrayList<SearchResultMatchI> matches = new ArrayList<>();
/**
* One match consists of a sequence reference, start and end positions.
/**
* One match consists of a sequence reference, start and end positions.
@@
-233,12
+231,7
@@
public class SearchResults implements SearchResultsI
{
Match m = new Match(sequence, start, end);
{
Match m = new Match(sequence, start, end);
- Match toAdd=null;
- if (matches.contains(m))
- {
- return false;
- }
boolean appending=false;
// we dynamically maintain an interval to add as we test each range in the list
boolean appending=false;
// we dynamically maintain an interval to add as we test each range in the list
@@
-249,6
+242,11
@@
public class SearchResults implements SearchResultsI
{
if (thatm.getSequence()==sequence)
{
{
if (thatm.getSequence()==sequence)
{
+ if (thatm.contains(sequence,cstart,cend))
+ {
+ // found a match containing the current range. nothing else to do except report if we operated on the list
+ return appending;
+ }
if (thatm.adjacent(sequence, cstart, cend))
{
// update the match to add with the adjacent start/end
if (thatm.adjacent(sequence, cstart, cend))
{
// update the match to add with the adjacent start/end
@@
-352,7
+350,7
@@
public class SearchResults implements SearchResultsI
else
{
// debug
else
{
// debug
- // System.err.println("Outwith bounds!" + matchStart+">"+end +" or "
+ // jalview.bin.Console.errPrintln("Outwith bounds!" + matchStart+">"+end +" or "
// + matchEnd+"<"+start);
}
}
// + matchEnd+"<"+start);
}
}
@@
-403,7
+401,7
@@
public class SearchResults implements SearchResultsI
@Override
public List<SearchResultMatchI> getResults()
{
@Override
public List<SearchResultMatchI> getResults()
{
- return List.copyOf(matches);
+ return matches;
}
/**
}
/**