/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** A class for extensible, mutable bit sets.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class Bits {
private int[] bits;
/** Construct an initially empty set.
*/
public Bits() {
this(new int[1]);
}
/** Construct a set consisting initially of given bit vector.
*/
}
/** Construct a set consisting initially of given range.
*/
this();
}
}
}
/** This set = {}.
*/
public void clear() {
}
/** Return a copy of this set.
*/
}
/** Include x in this set.
*/
public void incl(int x) {
(1 << (x & wordmask));
}
/** Include [start..limit) in this set.
*/
(1 << (x & wordmask));
}
/** Exclude [start...end] from this set.
*/
}
/** Exclude x from this set.
*/
public void excl(int x) {
~(1 << (x & wordmask));
}
/** Is x an element of this set?
*/
public boolean isMember(int x) {
return
}
/** this set = this set & xs.
*/
return this;
}
/** this set = this set | xs.
*/
return this;
}
/** this set = this set \ xs.
*/
}
}
return this;
}
/** this set = this set ^ xs.
*/
return this;
}
/** Count trailing zero bits in an int. Algorithm from "Hacker's
* Delight" by Henry S. Warren Jr. (figure 5-13)
*/
private static int trailingZeroBits(int x) {
if (x == 0) return 32;
int n = 1;
if ((x & 0xffff) == 0) { n += 16; x >>>= 16; }
if ((x & 0x00ff) == 0) { n += 8; x >>>= 8; }
if ((x & 0x000f) == 0) { n += 4; x >>>= 4; }
if ((x & 0x0003) == 0) { n += 2; x >>>= 2; }
return n - (x&1);
}
/** Return the index of the least bit position >= x that is set.
* If none are set, returns -1. This provides a nice way to iterate
* over the members of a bit set:
* <pre>
* for (int i = bits.nextBit(0); i>=0; i = bits.nextBit(i+1)) ...
* </pre>
*/
public int nextBit(int x) {
while (true) {
if (word != 0)
windex++;
}
}
/** a string representation of this set.
*/
}
/** Test Bits.nextBit(int). */
int dupCount = 0;
for (int i=0; i<125; i++) {
int k;
do {
k = r.nextInt(250);
}
int count = 0;
count ++;
}
}
}