- final int from = Math.max(start - 1, 0);
- String startPosition = String.valueOf(from);
- return startPosition + getCharacters();
- }
-
- /* (non-Javadoc)
- * @see jalview.datamodel.SearchResultMatchI#getCharacters()
- */
- @Override
- public String getCharacters()
- {
- 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;
+ StringBuilder sb = new StringBuilder();
+ if (sequence != null)
+ {
+ sb.append(sequence.getName()).append("/");
+ }
+ sb.append(start).append("-").append(end);
+ return sb.toString();