Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6410729

Add BitSet.previousClearBit, previousSetBit

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 7
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b20
    • CPU:
      generic, x86
    • OS:
      generic, linux, windows_xp
    • Verification:
      Verified

      Backports

        Description

        Josh Bloch writes,

        "In 1.4, we added methods nextSetBit(int) and nextClearBit(int). This was good as far as it went. We should also have added previousSetBit(int) and previousClearBit(int).

        The reason this is a reasonable RFE is that it's MUCH slower to code these methods up from the outside as you don't have access to the words that make up bit set, so you have to operate a bit at a time, range-checking the bit index each time. The resulting method is probably 100 times as slow as it should be. (I haven't timed it, so don't believe this estimate.)"

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  martin Martin Buchholz
                  Reporter:
                  martin Martin Buchholz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: