/**
* One match consists of a sequence reference, start and end positions.
* Discontiguous ranges in a sequence require two or more Match objects.
*/
/**
* One match consists of a sequence reference, start and end positions.
* Discontiguous ranges in a sequence require two or more Match objects.
*/
- return (sequence == seq && ((start <= from && end >= to) || (from<=(end+1) && to >=(end+1)) || (from<=(start-1) && to>=(start-1))));
+ return (sequence == seq && ((start <= from && end >= to)
+ || (from <= (end + 1) && to >= (end + 1))
+ || (from <= (start - 1) && to >= (start - 1))));
@Override
public boolean appendResult(SequenceI sequence, int start, int end)
{
Match m = new Match(sequence, start, end);
@Override
public boolean appendResult(SequenceI sequence, int start, int 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
-
- int cstart=start,cend=end;
- List<SearchResultMatchI> toRemove=new ArrayList<>();
- for (SearchResultMatchI thatm:matches)
+
+ boolean appending = false;
+
+ // we dynamically maintain an interval to add as we test each range in the
+ // list
+
+ int cstart = start, cend = end;
+ List<SearchResultMatchI> toRemove = new ArrayList<>();
+ for (SearchResultMatchI thatm : matches)
if (thatm.adjacent(sequence, cstart, cend))
{
// update the match to add with the adjacent start/end
start = Math.min(m.start, thatm.getStart());
end = Math.max(m.end, thatm.getEnd());
// and check if we keep or remove the old one
if (thatm.adjacent(sequence, cstart, cend))
{
// update the match to add with the adjacent start/end
start = Math.min(m.start, thatm.getStart());
end = Math.max(m.end, thatm.getEnd());
// and check if we keep or remove the old one