public class SearchResults implements SearchResultsI
{
- private List<Match> matches = new ArrayList<Match>();
+ private List<SearchResultMatchI> matches = new ArrayList<SearchResultMatchI>();
/**
* One match consists of a sequence reference, start and end positions.
@Override
public boolean equals(Object obj)
{
- if (obj == null || !(obj instanceof Match))
+ if (obj == null || !(obj instanceof SearchResultMatchI))
{
return false;
}
- Match m = (Match) obj;
- return (this.sequence == m.sequence && this.start == m.start && this.end == m.end);
+ SearchResultMatchI m = (SearchResultMatchI) obj;
+ return (sequence == m.getSequence() && start == m.getStart() && end == m
+ .getEnd());
}
}
public boolean involvesSequence(SequenceI sequence)
{
SequenceI ds = sequence.getDatasetSequence();
- for (Match m : matches)
+ Match m;
+ for (SearchResultMatchI _m : matches)
{
+ m = (Match) _m;
if (m.sequence != null
&& (m.sequence == sequence || m.sequence == ds))
{
int[] tmp = null;
int resultLength, matchStart = 0, matchEnd = 0;
boolean mfound;
- for (Match m : matches)
+ Match m;
+ for (SearchResultMatchI _m : matches)
{
+ m = (Match) _m;
+
mfound = false;
if (m.sequence == sequence)
{
@Override
public SequenceI getResultSequence(int index)
{
- return matches.get(index).sequence;
+ return matches.get(index).getSequence();
}
/* (non-Javadoc)
@Override
public int getResultStart(int i)
{
- return matches.get(i).start;
+ return matches.get(i).getStart();
}
/* (non-Javadoc)
@Override
public int getResultEnd(int i)
{
- return matches.get(i).end;
+ return matches.get(i).getEnd();
}
/* (non-Javadoc)
* @see jalview.datamodel.SearchResultsI#getResults()
*/
@Override
- public List<Match> getResults()
+ public List<SearchResultMatchI> getResults()
{
return matches;
}
@Override
public boolean equals(Object obj)
{
- if (obj == null || !(obj instanceof SearchResults))
+ if (obj == null || !(obj instanceof SearchResultsI))
{
return false;
}
- SearchResults sr = (SearchResults) obj;
- return ((ArrayList<Match>) this.matches).equals(sr.matches);
+ SearchResultsI sr = (SearchResultsI) obj;
+ return matches.equals(sr.getResults());
}
}