Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for newHashSetWithExpectedSize (0.19 sec)

  1. guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java

            queryList.add(candidate);
          }
        }
        shuffle(queryList, random);
        return queryList.toArray(new Element[0]);
      }
    
      private Set<Element> createData() {
        Set<Element> set = Sets.newHashSetWithExpectedSize(size);
        while (set.size() < size) {
          set.add(newElement());
        }
        return set;
      }
    
      private Element newElement() {
        int value = random.nextInt();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java

            queryList.add(candidate);
          }
        }
        shuffle(queryList, random);
        return queryList.toArray(new Element[0]);
      }
    
      private Set<Element> createData() {
        Set<Element> set = Sets.newHashSetWithExpectedSize(size);
        while (set.size() < size) {
          set.add(newElement());
        }
        return set;
      }
    
      private Element newElement() {
        int value = random.nextInt();
    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. guava-tests/test/com/google/common/collect/SetsTest.java

      }
    
      public void testNewHashSetWithExpectedSizeSmall() {
        HashSet<Integer> set = Sets.newHashSetWithExpectedSize(0);
        verifySetContents(set, EMPTY_COLLECTION);
      }
    
      public void testNewHashSetWithExpectedSizeLarge() {
        HashSet<Integer> set = Sets.newHashSetWithExpectedSize(1000);
        verifySetContents(set, EMPTY_COLLECTION);
      }
    
      public void testNewHashSetFromIterator() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 48.6K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

                .build(new DelayingIdentityLoader<String>(computationShouldWait, computationLatch));
    
        int nThreads = 100;
        int nTasks = 1000;
        int nSeededEntries = 100;
        Set<String> expectedKeys = Sets.newHashSetWithExpectedSize(nTasks + nSeededEntries);
        // seed the map, so its segments have a count>0; otherwise, clear() won't visit the in-progress
        // entries
        for (int i = 0; i < nSeededEntries; i++) {
          String s = "b" + i;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 24.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/Sets.java

       */
      @SuppressWarnings("NonApiType") // acts as a direct substitute for a constructor call
      public static <E extends @Nullable Object> HashSet<E> newHashSet(E... elements) {
        HashSet<E> set = newHashSetWithExpectedSize(elements.length);
        Collections.addAll(set, elements);
        return set;
      }
    
      /**
       * Creates a <i>mutable</i> {@code HashSet} instance containing the given elements. A very thin
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 78.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Maps.java

          try {
            return super.retainAll(checkNotNull(c));
          } catch (UnsupportedOperationException e) {
            // if the iterators don't support remove
            Set<@Nullable Object> keys = Sets.newHashSetWithExpectedSize(c.size());
            for (Object o : c) {
              /*
               * `o instanceof Entry` is guaranteed by `contains`, but we check it here to satisfy our
               * nullness checker.
               */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 161.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/Maps.java

          try {
            return super.retainAll(checkNotNull(c));
          } catch (UnsupportedOperationException e) {
            // if the iterators don't support remove
            Set<@Nullable Object> keys = Sets.newHashSetWithExpectedSize(c.size());
            for (Object o : c) {
              /*
               * `o instanceof Entry` is guaranteed by `contains`, but we check it here to satisfy our
               * nullness checker.
               */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 167.4K bytes
    - Viewed (0)
Back to top