+ public int getEnd()
+ {
+ return end;
+ }
+
+ /**
+ * Returns the string of characters in the matched region.
+ */
+ @Override
+ public String toString()
+ {
+ char[] chars = sequence.getSequence();
+ // convert start/end to base 0 (with bounds check)
+ final int from = Math.max(start - 1, 0);
+ final int to = Math.min(end, chars.length + 1);
+ return String.valueOf(Arrays.copyOfRange(chars, from, to));
+ }
+
+ public void setSequence(SequenceI seq)
+ {
+ this.sequence = seq;
+ }
+ }
+
+ /**
+ * This method replaces the old search results which merely held an alignment
+ * index of search matches. This broke when sequences were moved around the
+ * alignment
+ *
+ * @param seq
+ * Sequence
+ * @param start
+ * int
+ * @param end
+ * int
+ */
+ public void addResult(SequenceI seq, int start, int end)
+ {
+ matches.add(new Match(seq, start, end));
+ }