/** * Get the index of the next bit that is not set. * * @param fromIndex where to start searching * @return the index of the next disabled bit */ public int nextClearBit(int fromIndex) { int i = fromIndex >> ADDRESS_BITS; int max = data.length; for (; i < max; i++) { if (data[i] == -1) { continue; } int j = Math.max(fromIndex, i << ADDRESS_BITS); for (int end = j + 64; j < end; j++) { if (!get(j)) { return j; } } } return max << ADDRESS_BITS; }
private boolean shuffleTwo(TableFilter[] f) { int a = 0, b = 0, i = 0; for (; i < 20; i++) { a = random.nextInt(f.length); b = random.nextInt(f.length); if (a == b) { continue; } if (a < b) { int temp = a; a = b; b = temp; } int s = a * f.length + b; if (switched.get(s)) { continue; } switched.set(s); break; } if (i == 20) { return false; } TableFilter temp = f[a]; f[a] = f[b]; f[b] = temp; return true; }
private void checkRegistered(int parameterIndex) throws SQLException { try { checkIndexBounds(parameterIndex); if (!outParameters.get(parameterIndex - 1)) { throw DbException.getInvalidValueException("parameterIndex", parameterIndex); } } catch (Exception e) { throw logAndConvert(e); } }