X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FShiftList.java;h=15f455288cde6c0e164d05c30ad0fc3bffc7646b;hb=c16c1633e1a5acc9f44e4de40b9abbb8a59b99b4;hp=78b99ef1ff672670c3d68f603ddb7caad07776af;hpb=8906ee1e7c76cc694793097abbb0fefe4434bb5a;p=jalview.git diff --git a/src/jalview/util/ShiftList.java b/src/jalview/util/ShiftList.java index 78b99ef..15f4552 100644 --- a/src/jalview/util/ShiftList.java +++ b/src/jalview/util/ShiftList.java @@ -1,111 +1,144 @@ -package jalview.util; - -import jalview.datamodel.SequenceI; - -import java.util.*; - -/** - * ShiftList - * Simple way of mapping a linear series to a new linear range with new points introduced. - * Use at your own risk! - *

Title: ShiftList

- * - *

Description:

- * - *

Copyright: Copyright (c) 2004

- * - *

Company: Dundee University

- * - * @author not attributable - * @version 1.0 - */ -public class ShiftList -{ - public Vector shifts; - public ShiftList() - { - shifts = new Vector(); - } - - /** - * addShift - * @param pos start position for shift (in original reference frame) - * @param shift length of shift - */ - public void addShift(int pos, int shift) - { - int sidx = 0; - int[] rshift=null; - while (sidx0) { - shiftList=new ShiftList(); - - for (int i=0,p=0; i 0) + { + shiftList = new ShiftList(); + for (int i = 0, p = 0; i < gapMap.length; p++, i++) + { + if (p != gapMap[i]) + { + shiftList.addShift(p, gapMap[i] - p); + p = gapMap[i]; + } + } + } + return shiftList; + } +}