Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for createWithExpectedSize (0.1 sec)

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

        map.put(2, "c");
        map.remove(2);
        testHasMapEntriesInOrder(map, 1, "a", 4, "b", 3, "d");
      }
    
      public void testTrimToSize() {
        CompactLinkedHashMap<Integer, String> map = CompactLinkedHashMap.createWithExpectedSize(100);
        map.put(1, "a");
        map.put(4, "b");
        map.put(3, "d");
        map.put(2, "c");
        map.trimToSize();
        assertThat(map.entries).hasLength(4);
        assertThat(map.keys).hasLength(4);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Platform.java

        return CompactHashMap.createWithExpectedSize(expectedSize);
      }
    
      /**
       * Returns the platform preferred implementation of an insertion ordered map based on a hash
       * table.
       */
      static <K extends @Nullable Object, V extends @Nullable Object>
          Map<K, V> newLinkedHashMapWithExpectedSize(int expectedSize) {
        return CompactLinkedHashMap.createWithExpectedSize(expectedSize);
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 5.3K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/CompactHashSet.java

       */
      public static <E extends @Nullable Object> CompactHashSet<E> create(
          Collection<? extends E> collection) {
        CompactHashSet<E> set = createWithExpectedSize(collection.size());
        set.addAll(collection);
        return set;
      }
    
      /**
       * Creates a <i>mutable</i> {@code CompactHashSet} instance containing the given elements in
       * unspecified order.
       *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 23.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java

      }
    
      public void testAllocArraysExpectedSize() {
        for (int i = 0; i <= CompactHashing.DEFAULT_SIZE; i++) {
          CompactHashSet<Integer> set = CompactHashSet.createWithExpectedSize(i);
          assertThat(set.needsAllocArrays()).isTrue();
          assertThat(set.elements).isNull();
    
          set.add(1);
          assertThat(set.needsAllocArrays()).isFalse();
          int expectedSize = max(1, i);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Jan 25 16:19:30 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/CompactHashMapTest.java

                .createTestSuite());
        suite.addTestSuite(CompactHashMapTest.class);
        return suite;
      }
    
      public void testTrimToSize() {
        CompactHashMap<Integer, String> map = CompactHashMap.createWithExpectedSize(100);
        for (int i = 0; i < 10; i++) {
          map.put(i, Integer.toString(i));
        }
        map.trimToSize();
        assertThat(map.entries).hasLength(10);
        assertThat(map.keys).hasLength(10);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Jan 25 16:19:30 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/CompactLinkedHashSet.java

       */
      public static <E extends @Nullable Object> CompactLinkedHashSet<E> create(
          Collection<? extends E> collection) {
        CompactLinkedHashSet<E> set = createWithExpectedSize(collection.size());
        set.addAll(collection);
        return set;
      }
    
      /**
       * Creates a {@code CompactLinkedHashSet} instance containing the given elements in unspecified
       * order.
       *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 14:59:07 UTC 2025
    - 9.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java

        map.put(2, "c");
        map.remove(2);
        testHasMapEntriesInOrder(map, 1, "a", 4, "b", 3, "d");
      }
    
      public void testTrimToSize() {
        CompactLinkedHashMap<Integer, String> map = CompactLinkedHashMap.createWithExpectedSize(100);
        map.put(1, "a");
        map.put(4, "b");
        map.put(3, "d");
        map.put(2, "c");
        map.trimToSize();
        assertThat(map.entries).hasLength(4);
        assertThat(map.keys).hasLength(4);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/ObjectCountLinkedHashMap.java

       *     expectedSize} elements without resizing
       * @throws IllegalArgumentException if {@code expectedSize} is negative
       */
      static <K extends @Nullable Object> ObjectCountLinkedHashMap<K> createWithExpectedSize(
          int expectedSize) {
        return new ObjectCountLinkedHashMap<K>(expectedSize);
      }
    
      private static final int ENDPOINT = -2;
    
      /*
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 5.9K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/CompactHashMap.java

       *     elements without resizing
       * @throws IllegalArgumentException if {@code expectedSize} is negative
       */
      public static <K extends @Nullable Object, V extends @Nullable Object>
          CompactHashMap<K, V> createWithExpectedSize(int expectedSize) {
        return new CompactHashMap<>(expectedSize);
      }
    
      private static final Object NOT_FOUND = new Object();
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 39.6K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/CompactHashMap.java

       *     elements without resizing
       * @throws IllegalArgumentException if {@code expectedSize} is negative
       */
      public static <K extends @Nullable Object, V extends @Nullable Object>
          CompactHashMap<K, V> createWithExpectedSize(int expectedSize) {
        return new CompactHashMap<>(expectedSize);
      }
    
      private static final Object NOT_FOUND = new Object();
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 35.7K bytes
    - Viewed (0)
Back to top