+ final SequenceI sequence;
+
+ /**
+ * Start position of match in sequence (base 1)
+ */
+ final int start;
+
+ /**
+ * End position (inclusive) (base 1)
+ */
+ final int end;
+
+ /**
+ * create a Match on a range of sequence. Match always holds region in
+ * forwards order, even if given in reverse order (such as from a mapping to
+ * a reverse strand); this avoids trouble for routines that highlight search
+ * results etc
+ *
+ * @param seq
+ * a sequence
+ * @param start
+ * start position of matched range (base 1)
+ * @param end
+ * end of matched range (inclusive, base 1)
+ */
+ public Match(SequenceI seq, int start, int end)
+ {
+ sequence = seq;
+
+ /*
+ * always hold in forwards order, even if given in reverse order
+ * (such as from a mapping to a reverse strand); this avoids
+ * trouble for routines that highlight search results etc
+ */
+ if (start <= end)
+ {
+ this.start = start;
+ this.end = end;
+ }
+ else
+ {
+ // TODO: JBP could mark match as being specified in reverse direction
+ // for use
+ // by caller ? e.g. visualizing reverse strand highlight
+ this.start = end;
+ this.end = start;
+ }
+ }
+
+ @Override
+ public SequenceI getSequence()
+ {
+ return sequence;
+ }
+
+ @Override
+ public int getStart()