Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for newArrayListWithCapacity (0.12 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. android/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)
  6. android/guava-tests/test/com/google/common/collect/ListsTest.java

        ArrayList<Integer> list = Lists.newArrayListWithCapacity(0);
        assertEquals(emptyList(), list);
    
        ArrayList<Integer> bigger = Lists.newArrayListWithCapacity(256);
        assertEquals(emptyList(), bigger);
      }
    
      public void testNewArrayListWithCapacity_negative() {
        assertThrows(IllegalArgumentException.class, () -> Lists.newArrayListWithCapacity(-1));
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/ListsTest.java

        ArrayList<Integer> list = Lists.newArrayListWithCapacity(0);
        assertEquals(emptyList(), list);
    
        ArrayList<Integer> bigger = Lists.newArrayListWithCapacity(256);
        assertEquals(emptyList(), bigger);
      }
    
      public void testNewArrayListWithCapacity_negative() {
        assertThrows(IllegalArgumentException.class, () -> Lists.newArrayListWithCapacity(-1));
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/eventbus/SubscriberRegistry.java

       */
      Iterator<Subscriber> getSubscribers(Object event) {
        ImmutableSet<Class<?>> eventTypes = flattenHierarchy(event.getClass());
    
        List<Iterator<Subscriber>> subscriberIterators =
            Lists.newArrayListWithCapacity(eventTypes.size());
    
        for (Class<?> eventType : eventTypes) {
          CopyOnWriteArraySet<Subscriber> eventSubscribers = subscribers.get(eventType);
          if (eventSubscribers != null) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 15:16:45 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  9. android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java

        List<Parameter> params = factory.getParameters();
        List<FreshValueGenerator> argGenerators = Lists.newArrayListWithCapacity(params.size());
        List<@Nullable Object> args = Lists.newArrayListWithCapacity(params.size());
        for (Parameter param : params) {
          FreshValueGenerator generator = newFreshValueGenerator();
          argGenerators.add(generator);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:18:12 UTC 2024
    - 32.7K bytes
    - Viewed (0)
  10. guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

        EnumMap<E, LockGraphNode> map = Maps.newEnumMap(clazz);
        E[] keys = clazz.getEnumConstants();
        int numKeys = keys.length;
        ArrayList<LockGraphNode> nodes = Lists.newArrayListWithCapacity(numKeys);
        // Create a LockGraphNode for each enum value.
        for (E key : keys) {
          LockGraphNode node = new LockGraphNode(getLockName(key));
          nodes.add(node);
          map.put(key, node);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Dec 15 19:31:54 UTC 2023
    - 35.9K bytes
    - Viewed (0)
Back to top