- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for cap (0.14 sec)
-
android/guava-tests/test/com/google/common/collect/ImmutableSetTest.java
assertEquals(8, ImmutableSet.chooseTableSize(4)); assertEquals(1 << 29, ImmutableSet.chooseTableSize(1 << 28)); assertEquals(1 << 29, ImmutableSet.chooseTableSize((1 << 29) * 3 / 5)); // Now we hit the cap assertEquals(1 << 30, ImmutableSet.chooseTableSize(1 << 29)); assertEquals(1 << 30, ImmutableSet.chooseTableSize((1 << 30) - 1)); // Now we've gone too far
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Tue Feb 20 17:00:05 GMT 2024 - 13.7K bytes - Viewed (0) -
android/guava/src/com/google/common/util/concurrent/RateLimiter.java
* for (Runnable task : tasks) { * rateLimiter.acquire(); // may wait * executor.execute(task); * } * } * }</pre> * * <p>As another example, imagine that we produce a stream of data, and we want to cap it at 5kb per * second. This could be accomplished by requiring a permit per byte, and specifying a rate of 5000 * permits per second: * * <pre>{@code
Java - Registered: Fri Apr 26 12:43:10 GMT 2024 - Last Modified: Tue Apr 04 09:45:04 GMT 2023 - 18.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/ImmutableSetTest.java
assertEquals(8, ImmutableSet.chooseTableSize(4)); assertEquals(1 << 29, ImmutableSet.chooseTableSize(1 << 28)); assertEquals(1 << 29, ImmutableSet.chooseTableSize((1 << 29) * 3 / 5)); // Now we hit the cap assertEquals(1 << 30, ImmutableSet.chooseTableSize(1 << 29)); assertEquals(1 << 30, ImmutableSet.chooseTableSize((1 << 30) - 1)); // Now we've gone too far
Java - Registered: Fri Apr 19 12:43:09 GMT 2024 - Last Modified: Tue Feb 20 17:00:05 GMT 2024 - 13.9K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/ImmutableSortedSet.java
if (uniques < contents.length / 2) { // Deduplication eliminated many of the elements. We don't want to retain an arbitrarily // large array relative to the number of elements, so we cap the ratio. contents = Arrays.copyOf(contents, uniques); } return new RegularImmutableSortedSet<E>( ImmutableList.<E>asImmutableList(contents, uniques), comparator); } /**
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed May 01 18:44:57 GMT 2024 - 36.9K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/MinMaxPriorityQueue.java
if (initialContents instanceof Collection) { int initialSize = ((Collection<?>) initialContents).size(); result = Math.max(result, initialSize); } // Now cap it at maxSize + 1 return capAtMaximumSize(result, maximumSize); } private void growIfNeeded() { if (size > queue.length) { int newCapacity = calculateNewCapacity();
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Thu Feb 22 21:19:52 GMT 2024 - 34K bytes - Viewed (0) -
android/guava/src/com/google/common/util/concurrent/FuturesGetChecked.java
/* * It's very unlikely that any loaded Futures class will see getChecked called with more * than a handful of exceptions. But it seems prudent to set a cap on how many we'll cache. * This avoids out-of-control memory consumption, and it keeps the cache from growing so * large that doing the lookup is noticeably slower than redoing the work would be. *
Java - Registered: Fri Apr 26 12:43:10 GMT 2024 - Last Modified: Thu Dec 14 20:35:03 GMT 2023 - 10.3K bytes - Viewed (0) -
android/guava/src/com/google/common/primitives/Longs.java
if (digit < 0 || digit >= radix) { return null; } long accum = -digit; long cap = Long.MIN_VALUE / radix; while (index < string.length()) { digit = AsciiDigits.digit(string.charAt(index++)); if (digit < 0 || digit >= radix || accum < cap) { return null; } accum *= radix; if (accum < Long.MIN_VALUE + digit) { return null;
Java - Registered: Fri Apr 26 12:43:10 GMT 2024 - Last Modified: Thu Feb 15 16:12:13 GMT 2024 - 28.7K bytes - Viewed (0)