Lines Matching refs:bits

37     protected final static int BITS = 64;    // number of bits / long
47 /** The actual data bits */
48 protected long bits[];
50 /** Construct a bitset of size one word (64 bits) */
57 bits = bits_;
70 * @param nbits The size of the bitset in bits
73 bits = new long[((nbits - 1) >> LOG_BITS) + 1];
119 if (n >= bits.length) {
122 bits[n] |= bitMask(el);
126 * Grows the set to a larger number of bits.
130 int newSize = Math.max(bits.length << 1, numWordsToHold(bit));
132 System.arraycopy(bits, 0, newbits, 0, bits.length);
133 bits = newbits;
141 if (a.bits.length > bits.length) {
142 setSize(a.bits.length);
144 int min = Math.min(bits.length, a.bits.length);
146 bits[i] |= a.bits[i];
156 int n = Math.min(nwords, bits.length);
157 System.arraycopy(bits, 0, newbits, 0, n);
158 bits = newbits;
170 s.bits = new long[bits.length];
171 System.arraycopy(bits, 0, s.bits, 0, bits.length);
181 for (int i = bits.length - 1; i >= 0; i--) {
182 long word = bits[i];
201 int n = Math.min(this.bits.length, otherSet.bits.length);
203 // for any bits in common, compare
205 if (this.bits[i] != otherSet.bits[i]) {
210 // make sure any extra bits are off
212 if (this.bits.length > n) {
213 for (int i = n+1; i<this.bits.length; i++) {
214 if (this.bits[i] != 0) {
219 else if (otherSet.bits.length > n) {
220 for (int i = n+1; i<otherSet.bits.length; i++) {
221 if (otherSet.bits[i] != 0) {
235 if (n >= bits.length) return false;
236 return (bits[n] & bitMask(el)) != 0;
242 if (n < bits.length) {
243 bits[n] &= ~bitMask(el);
248 for (int i = bits.length - 1; i >= 0; i--) {
249 if (bits[i] != 0) return false;
259 return bits.length << LOG_BITS; // num words * bits per word
262 /** return how much space is being used by the bits array not
263 * how many actually have member bits on.
266 return bits.length;
280 for (int i = 0; i < (bits.length << LOG_BITS); i++) {
289 return bits;
306 for (int i = 0; i < (bits.length << LOG_BITS); i++) {