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
{
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.
{
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
{
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
@Override
public List<SearchResultMatchI> getResults()
{
- return List.copyOf(matches);
+ return matches;
}
/**