Vector v = getPositionsInRange(null, gapEnd, newGapEnd - gapEnd); for (Iterator i = v.iterator(); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark = newGapEnd + 1; }
setPositionsInRange(gapEnd, newGapEnd - gapEnd, newGapEnd + 1);
  protected void shiftGapEndUp(int newGapEnd)  {    if (newGapEnd == gapEnd)      return;    assert newGapEnd > gapEnd : "The new gap end must be greater than the "                                + "old gap end.";    Vector v = getPositionsInRange(null, gapEnd, newGapEnd - gapEnd);    for (Iterator i = v.iterator(); i.hasNext();)      {        GapContentPosition p = (GapContentPosition) i.next();        p.mark = newGapEnd + 1;      }    gapEnd = newGapEnd;  }