- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 24 for newArrayListWithCapacity (0.15 sec)
-
guava/src/com/google/common/util/concurrent/CollectionFuture.java
* or implied. See the License for the specific language governing permissions and limitations under * the License. */ package com.google.common.util.concurrent; import static com.google.common.collect.Lists.newArrayListWithCapacity; import static java.util.Collections.unmodifiableList; import com.google.common.annotations.GwtCompatible; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.Lists;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 25 13:13:32 UTC 2024 - 3.9K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java
random = new Random(0xdeadbeef); // fix the seed so results are comparable across runs int nonAlpha = size / nonAlphaRatio; int alpha = size - nonAlpha; List<Character> chars = Lists.newArrayListWithCapacity(size); for (int i = 0; i < alpha; i++) { chars.add(randomAlpha()); } for (int i = 0; i < nonAlpha; i++) { chars.add(randomNonAlpha()); } Collections.shuffle(chars, random);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.8K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java
return dummy; } @Benchmark int copyPreSizedArrayList(int reps) { int size = this.size; int tmp = 0; for (int rep = 0; rep < reps; rep++) { List<Object> builder = Lists.newArrayListWithCapacity(size); for (int i = 0; i < size; i++) { builder.add(OBJECT); } tmp += ImmutableList.copyOf(builder).size(); } return tmp; }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.3K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java
return dummy; } @Benchmark int copyPreSizedArrayList(int reps) { int size = this.size; int tmp = 0; for (int rep = 0; rep < reps; rep++) { List<Object> builder = Lists.newArrayListWithCapacity(size); for (int i = 0; i < size; i++) { builder.add(OBJECT); } tmp += ImmutableList.copyOf(builder).size(); } return tmp; }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.3K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java
Object[] array; ArrayList<Object> arrayList; LinkedList<Object> linkedList; @BeforeExperiment void setUp() { array = new Object[size]; arrayList = Lists.newArrayListWithCapacity(size); linkedList = Lists.newLinkedList(); for (int i = 0; i < size; i++) { Object value = new Object(); array[i] = value; arrayList.add(value); linkedList.add(value);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java
return valuesInSet; } Element[] getQueries() { return queries; } private Element[] createQueries(Set<Element> elementsInSet, int numQueries) { List<Element> queryList = Lists.newArrayListWithCapacity(numQueries); int numGoodQueries = (int) (numQueries * hitRate + 0.5); // add good queries int size = elementsInSet.size(); if (size > 0) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 4.1K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java
Object[] array; ArrayList<Object> arrayList; LinkedList<Object> linkedList; @BeforeExperiment void setUp() { array = new Object[size]; arrayList = Lists.newArrayListWithCapacity(size); linkedList = Lists.newLinkedList(); for (int i = 0; i < size; i++) { Object value = new Object(); array[i] = value; arrayList.add(value); linkedList.add(value);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java
return valuesInSet; } Element[] getQueries() { return queries; } private Element[] createQueries(Set<Element> elementsInSet, int numQueries) { List<Element> queryList = Lists.newArrayListWithCapacity(numQueries); int numGoodQueries = (int) (numQueries * hitRate + 0.5); // add good queries int size = elementsInSet.size(); if (size > 0) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 4.1K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java
random = new Random(0xdeadbeef); // fix the seed so results are comparable across runs int nonAlpha = size / nonAlphaRatio; int alpha = size - nonAlpha; List<Character> chars = Lists.newArrayListWithCapacity(size); for (int i = 0; i < alpha; i++) { chars.add(randomAlpha()); } for (int i = 0; i < nonAlpha; i++) { chars.add(randomNonAlpha()); } Collections.shuffle(chars, random);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java
q.remove(11); q.remove(10); // Now we're in the critical state: [1, 15, 13, 8, 14] // Removing 8 while iterating caused duplicates in iteration result. List<Integer> result = Lists.newArrayListWithCapacity(initial.size()); for (Iterator<Integer> iter = q.iterator(); iter.hasNext(); ) { Integer value = iter.next(); result.add(value); if (value == 8) { iter.remove(); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 35.9K bytes - Viewed (0)