Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 22 21:19:52 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  2. 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)
  3. android/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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Feb 21 18:32:41 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  4. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/LinkedListMultimap.java

          current.value = value;
        }
      }
    
      /** An {@code Iterator} over distinct keys in key head order. */
      private class DistinctKeyIterator implements Iterator<K> {
        final Set<K> seenKeys = Sets.<K>newHashSetWithExpectedSize(keySet().size());
        @CheckForNull Node<K, V> next = head;
        @CheckForNull Node<K, V> current;
        int expectedModCount = modCount;
    
        private void checkForConcurrentModification() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 13 14:11:58 UTC 2023
    - 27.5K bytes
    - Viewed (0)
  6. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Feb 21 18:32:41 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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