Lines Matching defs:bits

31      * Constructs a bit set to contain bits up to the given index (exclusive).
44 * @param bits {@code non-null;} bit set in question
47 public static int getMax(int[] bits) {
48 return bits.length * 0x20;
54 * @param bits {@code non-null;} bit set to operate on
58 public static boolean get(int[] bits, int idx) {
61 return (bits[arrayIdx] & bit) != 0;
67 * @param bits {@code non-null;} bit set to operate on
71 public static void set(int[] bits, int idx, boolean value) {
76 bits[arrayIdx] |= bit;
78 bits[arrayIdx] &= ~bit;
85 * @param bits {@code non-null;} bit set to operate on
88 public static void set(int[] bits, int idx) {
91 bits[arrayIdx] |= bit;
97 * @param bits {@code non-null;} bit set to operate on
100 public static void clear(int[] bits, int idx) {
103 bits[arrayIdx] &= ~bit;
110 * @param bits {@code non-null;} bit set to operate on
111 * @return {@code true} iff all bits are {@code false}
113 public static boolean isEmpty(int[] bits) {
114 int len = bits.length;
117 if (bits[i] != 0) {
126 * Gets the number of bits set to {@code true} in the given bit set.
128 * @param bits {@code non-null;} bit set to operate on
131 public static int bitCount(int[] bits) {
132 int len = bits.length;
136 count += Integer.bitCount(bits[i]);
143 * Returns whether any bits are set to {@code true} in the
146 * @param bits {@code non-null;} bit set to operate on
152 public static boolean anyInRange(int[] bits, int start, int end) {
153 int idx = findFirst(bits, start);
161 * @param bits {@code non-null;} bit set to operate on
166 public static int findFirst(int[] bits, int idx) {
167 int len = bits.length;
171 int word = bits[arrayIdx];
194 value &= ~((1 << idx) - 1); // Mask off too-low bits.
215 public static String toHuman(int[] bits) {
222 int bitsLength = 32 * bits.length;
224 if (Bits.get(bits, i)) {