Vector res = v; if (res == null) res = new Vector();
int end = offset + length; int startIndex; int endIndex; if (offset < gapStart) { if (offset == 0) startIndex = 0; else startIndex = searchFirst(offset); if (end >= gapStart) endIndex = searchFirst(end + (gapEnd - gapStart) + 1); else endIndex = searchFirst(end + 1); }
  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;  }