Add preceding() to BreakIterator

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 1.1.2
    • Component/s: core-libs
    • None
    • x86
    • windows_nt



      Name: bb33257 Date: 07/29/97


      BreakIterator should probably have a preceding() method as a
      counterpart to its following() method. An optimized algorithm
      for line breaking would estimate the number of characters in a
      line, set the iterator to point to the last break position before
      that point, and move forward from there. Right now, you have to
      do that by calling following() and then calling previous(). This
      has a fairly significant performance cose: following() starts at
      the specified position, rewinds to the first safe position it can
      iterate forward from (which is _a_ break position before the
      specified position, but not necessarily the _last_ one), and
      iterates forward until it reaches the first break position after
      the specified position. If I then call previous(), I then rewind
      back to a position I've already passed, possibly overshooting it
      again. A preceding() call could eliminate much of the extra
      seeking BreakIterator has to do in this case.
      ======================================================================

            Assignee:
            Unassigned
            Reporter:
            Brian Beck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: