public static int nearestGreaterCapacity(int desiredCapacity, int currentSize) { return nearestGreaterCapacity(desiredCapacity, currentSize, false); }
public static int nearestGreaterCapacity(int desiredCapacity, int currentSize) { return nearestGreaterCapacity(desiredCapacity, currentSize, false); }
public static long nearestGreaterCapacity(long desiredCapacity, long currentSize) { assert desiredCapacity >= 0L : "desiredCapacity must be non-negative"; if (desiredCapacity <= (long) MAX_REGULAR_INT_CAPACITY) return (long) nearestGreaterCapacity((int) desiredCapacity, (int) currentSize, false); if (desiredCapacity <= MAX_REGULAR_LONG_CAPACITY) { int capIndex = binarySearch(REGULAR_LONG_CAPACITIES, desiredCapacity); return capIndex < 0 ? REGULAR_LONG_CAPACITIES[~capIndex] : desiredCapacity; } return extraLargeCapacity(desiredCapacity); }
public static long nearestGreaterCapacity(long desiredCapacity, long currentSize) { assert desiredCapacity >= 0L : "desiredCapacity must be non-negative"; if (desiredCapacity <= (long) MAX_REGULAR_INT_CAPACITY) return (long) nearestGreaterCapacity((int) desiredCapacity, (int) currentSize, false); if (desiredCapacity <= MAX_REGULAR_LONG_CAPACITY) { int capIndex = binarySearch(REGULAR_LONG_CAPACITIES, desiredCapacity); return capIndex < 0 ? REGULAR_LONG_CAPACITIES[~capIndex] : desiredCapacity; } return extraLargeCapacity(desiredCapacity); }
private boolean tryRehashForExpansion() { int newCapacity = nearestGreaterCapacity(config.grow(capacity()), currentOrdinal, false); if (newCapacity > capacity()) { rehashTimer.start(); rehash(newCapacity); rehashCount++; rehashTimer.stop(); return true; } else { return false; } }
private int grownCapacity() { return nearestGreaterCapacity(configWrapper.grow(capacity()), size, doubleSizedArrays()); } }
private int grownCapacity() { return nearestGreaterCapacity(configWrapper.grow(capacity()), size, doubleSizedArrays()); } }
private int grownCapacity() { return nearestGreaterCapacity(configWrapper.grow(capacity()), size, doubleSizedArrays()); } }
private int grownCapacity() { return nearestGreaterCapacity(configWrapper.grow(capacity()), size, doubleSizedArrays()); } }