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

RFE: methods for additional bitwise operations in java.util.BitSet

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.2.0
    • 1.0.2
    • core-libs
    • None
    • 1.2beta4
    • sparc
    • solaris_2.5.1
    • Not verified



      Name: tb29552 Date: 09/22/97


      motivation for first 3 problems:
      I had a need to subtract one BitSet x from BitSet y.

      This is equivalant to x & !y.

      1.
      problem: BitSet does not have a method "not".
      work-around: Use "xor" with a BitSet containing 1's.

      2.
      problem: BitSet is "final".
      Therefore I could not define my own BitSet method, minus(BitSet y).
      work-around: Create a method, minus(BitSet x, BitSet y), in an unrelated
      class.

      3.
      not really a problem: Enumeration is not provided with BitSets
      work-around: Use the following loop, for (int i=0; i<bitset.size(); i++)

      4.
      problem: Want to enumerate a group of items without making a copy
      of the group.
      work-around: create a non-standard method to reset those variables
              used in the enumeration functions
      example: setting i=0 to go thru a BitSet again.
      ======================================================================

            jjb Josh Bloch (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: