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

java.util.BitSet needs firstSet and firstClear functions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • core-libs
    • beta
    • generic
    • generic
    • Verified



      Name: skT88420 Date: 09/22/99


      BitSet does not contain any way to efficiently determine the first index of a bit that is set or the first index of a bit that is not set.

      This would be extremely useful in applications using a BitSet as a "resource allocated" table.

      There are a few ways that the brute force method (looping over every bit) could be implemented if the isEmpty() (bug 4261102) were supported.

      None of these would be ideal however, as they still would have to break the original BitSet into logical unit sizes that may not map to the unit size implemented by the BitSet, which would represent the most efficient way to search the BitSet (unit by unit).

      Regardless, it is impossible to implement this functionality since all members of BitSet are private (even though the BitSet class has been downgraded from a final class to a non-final class)
      (Review ID: 95603)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: