GapContentPosition p = (GapContentPosition) i.next(); int offs = p.getOffset(); if (offs >= offset && offs < endOffs) res.add(p);
startIndex = searchFirst(offset + (gapEnd - gapStart)); endIndex = searchFirst(end + (gapEnd - gapStart) + 1); } if (v == null) v = new Vector(); for (int i = startIndex; i < endIndex; i++) { v.add(new UndoPosRef((Mark) marks.get(i)));
  protected Vector getPositionsInRange(Vector v, int offset, int length)  {    Vector res = v;    if (res == null)      res = new Vector();    else      res.clear();    int endOffs = offset + length;    Set positionSet = positions.keySet();    for (Iterator i = positionSet.iterator(); i.hasNext();)      {        GapContentPosition p = (GapContentPosition) i.next();        int offs = p.getOffset();        if (offs >= offset && offs < endOffs)          res.add(p);      }    return res;  }