equal
deleted
inserted
replaced
278 * Fetch the location in the contiguous sequence |
278 * Fetch the location in the contiguous sequence |
279 * being modeled. The index in the gap array |
279 * being modeled. The index in the gap array |
280 * is held by the mark, so it is adjusted according |
280 * is held by the mark, so it is adjusted according |
281 * to it's relationship to the gap. |
281 * to it's relationship to the gap. |
282 */ |
282 */ |
283 public final int getOffset() { |
283 public int getOffset() { |
284 int g0 = getGapStart(); |
284 int g0 = getGapStart(); |
285 int g1 = getGapEnd(); |
285 int g1 = getGapEnd(); |
286 int offs = (index < g0) ? index : index - (g1 - g0); |
286 int offs = (index < g0) ? index : index - (g1 - g0); |
287 return Math.max(offs, 0); |
287 return Math.max(offs, 0); |
288 } |
288 } |
300 |
300 |
301 void setMark(MarkData mark) { |
301 void setMark(MarkData mark) { |
302 this.mark = mark; |
302 this.mark = mark; |
303 } |
303 } |
304 |
304 |
305 public final int getOffset() { |
305 public int getOffset() { |
306 return mark.getOffset(); |
306 return mark.getOffset(); |
307 } |
307 } |
308 |
308 |
309 public String toString() { |
309 public String toString() { |
310 return Integer.toString(getOffset()); |
310 return Integer.toString(getOffset()); |