Lines Matching defs:BitSet

2  * A BitSet similar to java.util.BitSet.
14 org.antlr.runtime.BitSet = function(bits) {
16 bits = org.antlr.runtime.BitSet.BITS;
21 * An array of Numbers representing the BitSet.
30 org.antlr.lang.augmentObject(org.antlr.runtime.BitSet, {
34 * @memberOf org.antlr.runtime.BitSet
41 * @memberOf org.antlr.runtime.BitSet
51 * @memberOf org.antlr.runtime.BitSet
62 * @memberOf org.antlr.runtime.BitSet
66 var bitPosition = bitNumber & org.antlr.runtime.BitSet.MOD_MASK;
72 * @param {Number} el a number to be included in the BitSet.
73 * @returns {Number} the number of bits need to create a BitSet with member
75 * @memberOf org.antlr.runtime.BitSet
79 return (el >> org.antlr.runtime.BitSet.LOG_BITS) + 1;
83 * @param {Number} bit a number to be included in the BitSet
86 * @memberOf org.antlr.runtime.BitSet
90 return bit >> org.antlr.runtime.BitSet.LOG_BITS; // bit / BITS
94 * BitSet factory method.
98 * <li>If el is a number create the BitSet containing that number.</li>
99 * <li>If el is an array create the BitSet containing each number in the
101 * <li>If el is a BitSet return el.</li>
102 * <li>If el is an Object create the BitSet containing each numeric value
104 * <li>If el is a number and el2 is a number return a BitSet containing
108 * @param {Number|Array|org.antlr.runtime.BitSet|Object} el
110 * @returns {org.antlr.runtime.BitSet}
111 * @memberOf org.antlr.runtime.BitSet
118 s = new org.antlr.runtime.BitSet(el2 + 1);
120 n = org.antlr.runtime.BitSet.wordNumber(i);
121 s.bits[n] |= org.antlr.runtime.BitSet.bitMask(i);
125 s = new org.antlr.runtime.BitSet(el + 1);
130 s = new org.antlr.runtime.BitSet();
135 } else if (el instanceof org.antlr.runtime.BitSet) {
144 s = new org.antlr.runtime.BitSet();
154 return org.antlr.runtime.BitSet.of(keys);
161 org.antlr.runtime.BitSet.prototype = {
167 var n = org.antlr.runtime.BitSet.wordNumber(el);
171 this.bits[n] |= org.antlr.runtime.BitSet.bitMask(el);
176 * @param {Array|org.antlr.runtime.BitSet} elements the elements to be added to
184 if ( elements instanceof org.antlr.runtime.BitSet ) {
193 this.orInPlace(BitSet.range(I.a,I.b));
206 * Clone this BitSet and then {@link #andInPlace} with a.
207 * @param {org.antlr.runtime.BitSet} a a bit set.
208 * @returns {org.antlr.runtime.BitSet}
217 * Perform a logical AND of this target BitSet with the argument BitSet.
222 * @param {org.antlr.runtime.BitSet} a a bit set.
223 * @returns {org.antlr.runtime.BitSet}
240 * If no arguments given, sets all of the bits in this BitSet to false.
253 var n = org.antlr.runtime.BitSet.wordNumber(el);
257 this.bits[n] &= ~org.antlr.runtime.BitSet.bitMask(el);
261 * Cloning this BitSet produces a new BitSet that is equal to it.
265 * @returns {org.antlr.runtime.BitSet} a clone of this BitSet.
272 return new org.antlr.runtime.BitSet(b);
276 * Returns the number of bits of space actually in use by this BitSet to
287 for (bit = org.antlr.runtime.BitSet.BITS - 1; bit >= 0; bit--) {
301 * BitSet object that has exactly the same set of bits set to true as
304 * ((BitSet)obj).get(k) == this.get(k)
311 if ( !other || !(other instanceof org.antlr.runtime.BitSet) ) {
352 var newSize = Math.max(this.bits.length << 1, org.antlr.runtime.BitSet.numWordsToHold(bit)),
366 * in this BitSet; otherwise, the result is false.
371 var n = org.antlr.runtime.BitSet.wordNumber(el);
373 return (this.bits[n] & org.antlr.runtime.BitSet.bitMask(el)) !== 0;
383 for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
392 * Returns true if this BitSet contains no bits that are set to true.
393 * @returns {Boolean} boolean indicating whether this BitSet is empty.
409 * @param {org.antlr.runtime.BitSet} [set]
410 * @returns {org.antlr.runtime.BitSet}
449 n = org.antlr.runtime.BitSet.wordNumber(i);
450 this.bits[n] ^= org.antlr.runtime.BitSet.bitMask(i);
462 * @param {org.antlr.runtime.BitSet} [a] a bit set.
463 * @returns {org.antlr.runtime.BitSet}
476 * @param {org.antlr.runtime.BitSet} [a]
477 * @returns {org.antlr.runtime.BitSet}
499 var n = org.antlr.runtime.BitSet.wordNumber(el);
503 this.bits[n] &= ~org.antlr.runtime.BitSet.bitMask(el);
527 return this.bits.length << org.antlr.runtime.BitSet.LOG_BITS; // num words * bits per word
542 * @param {org.antlr.runtime.BitSet} a bit set
554 * @param {org.antlr.runtime.BitSet} a bit set.
567 * @param {org.antlr.runtime.BitSet} a bit set.
568 * @returns {org.antlr.runtime.BitSet} the new bit set.
571 if (!a || !(a instanceof org.antlr.runtime.BitSet)) { return null; }
580 throw new Error("BitSet.toList() unimplemented");
592 for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
611 * <p>For every index for which this BitSet contains a bit in the set state,
660 for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
688 for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {