*/
public void restrict(int startRes, int endRes)
{
+ if (startRes<0)
+ startRes=0;
+ if (startRes>=annotations.length)
+ startRes = annotations.length-1;
+ if (endRes>=annotations.length)
+ endRes = annotations.length-1;
if (annotations==null)
return;
Annotation[] temp = new Annotation[endRes-startRes+1];
if (startRes<annotations.length)
{
- System.arraycopy(annotations, startRes, temp, 0, Math.min(endRes, annotations.length-1)-startRes+1);
+ System.arraycopy(annotations, startRes, temp, 0, endRes-startRes+1);
}
if (sequenceRef!=null) {
// Clip the mapping, if it exists.