Lines Matching defs:BitArray
38 public class BitArray {
54 * Creates a BitArray of the specified size, initialized to zeros.
56 public BitArray(int length) throws IllegalArgumentException {
58 throw new IllegalArgumentException("Negative length for BitArray");
68 * Creates a BitArray of the specified size, initialized from the
70 * index zero in the BitArray. The array a must be large enough
71 * to specify a value for every bit in the BitArray. In other words,
74 public BitArray(int length, byte[] a) throws IllegalArgumentException {
77 throw new IllegalArgumentException("Negative length for BitArray");
103 * Create a BitArray whose bits are those of the given array
106 public BitArray(boolean[] bits) {
119 private BitArray(BitArray ba) {
125 * Returns the indexed bit in this BitArray.
136 * Sets the indexed bit in this BitArray.
154 * Returns the length of this BitArray.
161 * Returns a Byte array containing the contents of this BitArray.
162 * The bit stored at index zero in this BitArray will be copied
166 * bits in the BitArray. (This matters only if the BitArray's size
175 if (obj == null || !(obj instanceof BitArray)) return false;
177 BitArray ba = (BitArray) obj;
188 * Return a boolean array with the same bit values a this BitArray.
215 return new BitArray(this);
241 * Returns a string representation of this BitArray.
266 public BitArray truncate() {
269 return new BitArray(i+1, Arrays.copyOf(repn, (i + BITS_PER_UNIT)/BITS_PER_UNIT));
272 return new BitArray(1);