| java.lang.Object | |
| ↳ | java.util.BitSet | 
The BitSet class implements a bit field. Each element in a
 BitSet can be on(1) or off(0). A BitSet is created with a
 given size and grows if this size is exceeded. Growth is always rounded to a
 64 bit boundary.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Create a new  BitSetwith size equal to 64 bits. | |||||||||||
| Create a new  BitSetwith size equal to nbits. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Performs the logical AND of this  BitSetwith anotherBitSet. | |||||||||||
| Clears all bits in the receiver which are also set in the parameter
  BitSet. | |||||||||||
| Returns the number of bits that are  truein thisBitSet. | |||||||||||
| Clears all the bits in this  BitSet. | |||||||||||
| Clears the bits starting from  pos1topos2. | |||||||||||
| Clears the bit at index  pos. | |||||||||||
| Creates a copy of this  BitSet. | |||||||||||
| Compares the argument to this  BitSetand returns whether they are
 equal. | |||||||||||
| Flips the bits starting from  pos1topos2. | |||||||||||
| Flips the bit at index  pos. | |||||||||||
| Retrieves the bit at index  pos. | |||||||||||
| Retrieves the bits starting from  pos1topos2and returns
 back a new bitset made of these bits. | |||||||||||
| Computes the hash code for this  BitSet. | |||||||||||
| Checks if these two  BitSets have at least one bit set to true in the same
 position. | |||||||||||
| Returns true if all the bits in this  BitSetare set to false. | |||||||||||
| Returns the number of bits up to and including the highest bit set. | |||||||||||
| Returns the position of the first bit that is  falseon or afterpos. | |||||||||||
| Returns the position of the first bit that is  trueon or afterpos. | |||||||||||
| Performs the logical OR of this  BitSetwith anotherBitSet. | |||||||||||
| Sets the bit at index  posto 1. | |||||||||||
| Sets the bit at index  postoval. | |||||||||||
| Sets the bits starting from  pos1topos2. | |||||||||||
| Sets the bits starting from  pos1topos2to the givenval. | |||||||||||
| Returns the number of bits this  BitSethas. | |||||||||||
| Returns a string containing a concise, human-readable description of the
 receiver. | |||||||||||
| Performs the logical XOR of this  BitSetwith anotherBitSet. | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class java.lang.Object | |||||||||||
Create a new BitSet with size equal to nbits. If nbits is not a
 multiple of 64, then create a BitSet with size nbits rounded to
 the next closest multiple of 64.
| nbits | the size of the bit set. | 
|---|
| NegativeArraySizeException | if nbitsis negative. | 
|---|
Performs the logical AND of this BitSet with another 
 BitSet. The values of this BitSet are changed accordingly.
| bs | BitSetto AND with. | 
|---|
Clears all bits in the receiver which are also set in the parameter
 BitSet. The values of this BitSet are changed accordingly.
| bs | BitSetto ANDNOT with. | 
|---|
Returns the number of bits that are true in this BitSet.
true bits in the set.Clears the bits starting from pos1 to pos2. Grows the
 BitSet if pos2 > size.
| pos1 | beginning position. | 
|---|---|
| pos2 | ending position. | 
| IndexOutOfBoundsException | if pos1orpos2is negative, or ifpos2is smaller thanpos1. | 
|---|
Clears the bit at index pos. Grows the BitSet if
 pos > size.
| pos | the index of the bit to clear. | 
|---|
| IndexOutOfBoundsException | if posis negative. | 
|---|
Creates a copy of this BitSet.
BitSet.Compares the argument to this BitSet and returns whether they are
 equal. The object must be an instance of BitSet with the same
 bits set.
| obj | the BitSetobject to compare. | 
|---|
boolean indicating whether or not this BitSet and
         obj are equal.Flips the bits starting from pos1 to pos2. Grows the
 BitSet if pos2 > size.
| pos1 | beginning position. | 
|---|---|
| pos2 | ending position. | 
| IndexOutOfBoundsException | if pos1orpos2is negative, or ifpos2is smaller thanpos1. | 
|---|
Flips the bit at index pos. Grows the BitSet if
 pos > size.
| pos | the index of the bit to flip. | 
|---|
| IndexOutOfBoundsException | if posis negative. | 
|---|
Retrieves the bit at index pos. Grows the BitSet if
 pos > size.
| pos | the index of the bit to be retrieved. | 
|---|
true if the bit at pos is set,
         false otherwise.| IndexOutOfBoundsException | if posis negative. | 
|---|
Retrieves the bits starting from pos1 to pos2 and returns
 back a new bitset made of these bits. Grows the BitSet if
 pos2 > size.
| pos1 | beginning position. | 
|---|---|
| pos2 | ending position. | 
| IndexOutOfBoundsException | if pos1orpos2is negative, or ifpos2is smaller thanpos1. | 
|---|
Computes the hash code for this BitSet. If two BitSets are equal
 the have to return the same result for hashCode().
int representing the hash code for this bit
         set.Checks if these two BitSets have at least one bit set to true in the same
 position.
| bs | BitSetused to calculate the intersection. | 
|---|
true if bs intersects with this BitSet,
         false otherwise.Returns true if all the bits in this BitSet are set to false.
true if the BitSet is empty,
         false otherwise.Returns the number of bits up to and including the highest bit set.
BitSet.Returns the position of the first bit that is false on or after pos.
| pos | the starting position (inclusive). | 
|---|
false, even if it is further
         than this BitSet's size.Returns the position of the first bit that is true on or after pos.
| pos | the starting position (inclusive). | 
|---|
true on or after pos.Performs the logical OR of this BitSet with another BitSet.
 The values of this BitSet are changed accordingly.
| bs | BitSetto OR with. | 
|---|
Sets the bit at index pos to 1. Grows the BitSet if
 pos > size.
| pos | the index of the bit to set. | 
|---|
| IndexOutOfBoundsException | if posis negative. | 
|---|
Sets the bit at index pos to val. Grows the
 BitSet if pos > size.
| pos | the index of the bit to set. | 
|---|---|
| val | value to set the bit. | 
| IndexOutOfBoundsException | if posis negative. | 
|---|
Sets the bits starting from pos1 to pos2. Grows the
 BitSet if pos2 > size.
| pos1 | beginning position. | 
|---|---|
| pos2 | ending position. | 
| IndexOutOfBoundsException | if pos1orpos2is negative, or ifpos2is smaller thanpos1. | 
|---|
Sets the bits starting from pos1 to pos2 to the given
 val. Grows the BitSet if pos2 > size.
| pos1 | beginning position. | 
|---|---|
| pos2 | ending position. | 
| val | value to set these bits. | 
| IndexOutOfBoundsException | if pos1orpos2is negative, or ifpos2is smaller thanpos1. | 
|---|
Returns the number of bits this BitSet has.
BitSet.Returns a string containing a concise, human-readable description of the receiver.
Performs the logical XOR of this BitSet with another BitSet.
 The values of this BitSet are changed accordingly.
| bs | BitSetto XOR with. | 
|---|