7 * Simple way of mapping a linear series to a new linear range with new points introduced.
8 * Use at your own risk!
9 * <p>Title: ShiftList</p>
11 * <p>Description: </p>
13 * <p>Copyright: Copyright (c) 2004</p>
15 * <p>Company: Dundee University</p>
17 * @author not attributable
20 public class ShiftList
25 shifts = new Vector();
30 * @param pos start position for shift (in original reference frame)
31 * @param shift length of shift
33 public void addShift(int pos, int shift)
37 while (sidx<shifts.size() && (rshift=(int[]) shifts.get(sidx))[0]<pos)
39 if (sidx==shifts.size())
40 shifts.insertElementAt(new int[] { pos, shift}, 0);
49 * @return int shifted position
51 public int shift(int pos)
58 while (sidx<shifts.size()
60 (rshift=((int[]) shifts.get(sidx++)))[0]<=pos) {
71 shifts.removeAllElements();