Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 19 of 19 for newHashSetWithExpectedSize (0.14 sec)

  1. android/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 Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 45.3K bytes
    - Viewed (0)
  2. 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 Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 81.6K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/MultimapBuilder.java

          this.expectedValuesPerKey = checkNonnegative(expectedValuesPerKey, "expectedValuesPerKey");
        }
    
        @Override
        public Set<V> get() {
          return Platform.newHashSetWithExpectedSize(expectedValuesPerKey);
        }
      }
    
      private static final class LinkedHashSetSupplier<V extends @Nullable Object>
          implements Supplier<Set<V>>, Serializable {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Jul 16 17:42:14 UTC 2025
    - 18K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/MultimapBuilder.java

          this.expectedValuesPerKey = checkNonnegative(expectedValuesPerKey, "expectedValuesPerKey");
        }
    
        @Override
        public Set<V> get() {
          return Platform.newHashSetWithExpectedSize(expectedValuesPerKey);
        }
      }
    
      private static final class LinkedHashSetSupplier<V extends @Nullable Object>
          implements Supplier<Set<V>>, Serializable {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Jul 16 17:42:14 UTC 2025
    - 18K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/HashTestUtils.java

       * collision rate looks sane.
       */
      static void assertInvariants(HashFunction hashFunction) {
        int objects = 100;
        Set<HashCode> hashcodes = Sets.newHashSetWithExpectedSize(objects);
        Random random = new Random(314159);
        for (int i = 0; i < objects; i++) {
          int value = random.nextInt();
          HashCode hashcode1 = hashFunction.hashInt(value);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 25.6K bytes
    - Viewed (0)
  6. android/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 Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 25.1K bytes
    - Viewed (0)
  7. 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 Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 25K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/ImmutableSet.java

        private final Set<Object> delegate;
    
        JdkBackedSetBuilderImpl(SetBuilderImpl<E> toCopy) {
          super(toCopy); // initializes dedupedElements and distinct
          delegate = Sets.newHashSetWithExpectedSize(distinct);
          for (int i = 0; i < distinct; i++) {
            /*
             * requireNonNull is safe because we ensure that the first `distinct` elements have been
             * populated.
             */
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 35.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/base/CharMatcherTest.java

          checkExactMatches(m, chars);
        }
      }
    
      static void checkExactMatches(CharMatcher m, char[] chars) {
        Set<Character> positive = Sets.newHashSetWithExpectedSize(chars.length);
        for (char c : chars) {
          positive.add(c);
        }
        for (int c = 0; c <= Character.MAX_VALUE; c++) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 30.4K bytes
    - Viewed (0)
Back to top