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

java.util.BitSet bulk set or clear

XMLWordPrintable

    • beta
    • x86
    • windows_95



      Name: tb29552 Date: 09/24/98


      If a range of bits needs to be set() or clear()ed,
      which is a very common operation, it would be
      *significantly* faster to provide alternate
      methods that take the range in two arguments, ie.
          public void set(int firstIndex, int lastIndex)
          public void clear(int firstIndex, int lastIndex)
      rather than looping around bit-by-bit [if it's not
      obvious how, contact me and I'll describe it, or
      even write the code for it].

      Even faster could be a no-argument version of set()
      and clear() that did the entire BitSet up to its
      logical length.

      I would strongly suggest these be added to JDK 1.2,
      and all internal uses of BitSet be checked to see
      if they call set() or clear() in a loop - it could
      yield dramatic speedups. Even if not, since BitSet
      cannot be effectively subclassed, you should provide
      the feature for us users.

      Note I'm looking at the docs & source for 1.2Beta2;
      if it's already been done in Beta4, please do tell me.
      (Review ID: 39414)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: