+ /**
+ * Hashcode is derived from the list of matches. This ensures that when two
+ * SearchResults objects satisfy the test for equals(), then they have the
+ * same hashcode.
+ *
+ * @see Match#hashCode()
+ * @see java.util.AbstractList#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ return matches.hashCode();
+ }
+
+ /**
+ * Two SearchResults are considered equal if they contain the same matches
+ * (Sequence, start position, end position) in the same order
+ *
+ * @see Match#equals(Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == null || !(obj instanceof SearchResultsI))
+ {
+ return false;
+ }
+ SearchResultsI sr = (SearchResultsI) obj;
+ return matches.equals(sr.getResults());
+ }