- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 28 for ensureCapacity (0.07 sec)
-
guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSet.java
contents.ensureCapacity(contents.size() + elements.length); super.add(elements); return this; } @CanIgnoreReturnValue @Override public Builder<E> addAll(Iterable<? extends E> elements) { if (elements instanceof Collection) { Collection<?> collection = (Collection<?>) elements; contents.ensureCapacity(contents.size() + collection.size()); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Wed Aug 06 18:32:41 UTC 2025 - 8.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/primitives/BytesTest.java
} } public void testEnsureCapacity() { assertThat(Bytes.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Bytes.ensureCapacity(ARRAY1, 0, 1)).isSameInstanceAs(ARRAY1); assertThat(Bytes.ensureCapacity(ARRAY1, 1, 1)).isSameInstanceAs(ARRAY1); assertThat(Bytes.ensureCapacity(ARRAY1, 2, 1)) .isEqualTo(new byte[] {(byte) 1, (byte) 0, (byte) 0}); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 17.5K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java
public void setUp() { // precalculate some random strings of ascii characters. StringBuilder sb = new StringBuilder(); Random random = new Random(0xdeadbeef); // for unpredictable but reproducible behavior sb.ensureCapacity(size); for (int k = 0; k < size; k++) { // [9-127) includes all ascii non-control characters sb.append((char) (random.nextInt(127 - 9) + 9)); } data = sb.toString(); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 3.2K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/primitives/CharsTest.java
} public void testEnsureCapacity() { assertThat(Chars.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Chars.ensureCapacity(ARRAY1, 0, 1)).isSameInstanceAs(ARRAY1); assertThat(Chars.ensureCapacity(ARRAY1, 1, 1)).isSameInstanceAs(ARRAY1); assertThat(Chars.ensureCapacity(ARRAY1, 2, 1)) .isEqualTo(new char[] {(char) 1, (char) 0, (char) 0}); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 25.9K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/primitives/DoublesTest.java
} } public void testEnsureCapacity() { assertThat(Doubles.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Doubles.ensureCapacity(ARRAY1, 0, 1)).isSameInstanceAs(ARRAY1); assertThat(Doubles.ensureCapacity(ARRAY1, 1, 1)).isSameInstanceAs(ARRAY1); assertThat(Arrays.equals(new double[] {1.0, 0.0, 0.0}, Doubles.ensureCapacity(ARRAY1, 2, 1))) .isTrue(); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 30.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/primitives/IntsTest.java
} } public void testEnsureCapacity() { assertThat(Ints.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Ints.ensureCapacity(ARRAY1, 0, 1)).isSameInstanceAs(ARRAY1); assertThat(Ints.ensureCapacity(ARRAY1, 1, 1)).isSameInstanceAs(ARRAY1); assertThat(Ints.ensureCapacity(ARRAY1, 2, 1)).isEqualTo(new int[] {(int) 1, (int) 0, (int) 0}); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 29.2K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java
public void setUp() { charset = Charset.forName(charsetName); StringBuilder sb = new StringBuilder(); Random random = new Random(0xdeadbeef); // for unpredictable but reproducible behavior sb.ensureCapacity(size); for (int k = 0; k < size; k++) { // [9-127) includes all ascii non-control characters sb.append((char) (random.nextInt(127 - 9) + 9)); } String string = sb.toString();
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 5.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/primitives/BooleansTest.java
} } public void testEnsureCapacity() { assertThat(Booleans.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Booleans.ensureCapacity(ARRAY_FALSE, 0, 1)).isSameInstanceAs(ARRAY_FALSE); assertThat(Booleans.ensureCapacity(ARRAY_FALSE, 1, 1)).isSameInstanceAs(ARRAY_FALSE); assertThat(Booleans.ensureCapacity(new boolean[] {true}, 2, 1)) .isEqualTo(new boolean[] {true, false, false}); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 25K bytes - Viewed (0) -
guava-tests/test/com/google/common/primitives/DoublesTest.java
} } public void testEnsureCapacity() { assertThat(Doubles.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Doubles.ensureCapacity(ARRAY1, 0, 1)).isSameInstanceAs(ARRAY1); assertThat(Doubles.ensureCapacity(ARRAY1, 1, 1)).isSameInstanceAs(ARRAY1); assertThat(Arrays.equals(new double[] {1.0, 0.0, 0.0}, Doubles.ensureCapacity(ARRAY1, 2, 1))) .isTrue(); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 30.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/primitives/LongsTest.java
} } public void testEnsureCapacity() { assertThat(Longs.ensureCapacity(EMPTY, 0, 1)).isSameInstanceAs(EMPTY); assertThat(Longs.ensureCapacity(ARRAY1, 0, 1)).isSameInstanceAs(ARRAY1); assertThat(Longs.ensureCapacity(ARRAY1, 1, 1)).isSameInstanceAs(ARRAY1); assertThat(Longs.ensureCapacity(ARRAY1, 2, 1)).isEqualTo(new long[] {1L, 0L, 0L}); } public void testEnsureCapacity_fail() {
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 28.7K bytes - Viewed (0)