GapContentPosition pos = null; Set positionSet = positions.keySet(); for (Iterator i = positionSet.iterator(); i.hasNext();)
Mark m; GapContentPosition pos; int index = offset; if (offset >= gapStart) index += (gapEnd - gapStart); searchMark.mark = index; int insertIndex = search(searchMark); if (!(insertIndex < marks.size() && (m = (Mark) marks.get(insertIndex)).mark == index && (pos = m.getPosition()) != null))
  public Position createPosition(final int offset) throws BadLocationException  {    // We try to find a GapContentPosition at the specified offset and return    // that. Otherwise we must create a new one.    GapContentPosition pos = null;    Set positionSet = positions.keySet();    for (Iterator i = positionSet.iterator(); i.hasNext();)      {        GapContentPosition p = (GapContentPosition) i.next();        if (p.getOffset() == offset)          {            pos = p;            break;          }      }    // If none was found, then create and return a new one.    if (pos == null)      {    int mark = offset;        if (mark >= gapStart)          mark += (gapEnd - gapStart);        pos = new GapContentPosition(mark);        positions.put(pos, null);      }    return pos;  }