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

Add BitSet.previousClearBit, previousSetBit

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 6
    • core-libs
    • b20
    • generic, x86
    • generic, linux, windows_xp
    • Verified

        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.)"

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: