int (int startOffset, int endOffset) { int startIndex = getSoftWrapIndex(startOffset); if (startIndex < 0) { startIndex = -startIndex - 1; } if (startIndex >= myWraps.size()) { return 0; } int result = 0; int endIndex = startIndex; for (; endIndex < myWraps.size(); endIndex++) { SoftWrap softWrap = myWraps.get(endIndex); if (softWrap.getStart() > endOffset) { break; } result++; } return result; }