Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for builderWithExpectedSize (0.23 sec)

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

          ImmutableSet<Integer> unused = builder.build();
        }
      }
    
      @GwtIncompatible("Builder impl")
      public void testPresizedBuilderDedups() {
        ImmutableSet.Builder<String> builder = ImmutableSet.builderWithExpectedSize(4);
        builder.add("a");
        assertEquals(1, builder.size);
        builder.add("a");
        assertEquals(1, builder.size);
        builder.add("b", "c", "d");
        assertEquals(4, builder.size);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java

        @Override
        protected Set<String> create(String[] elements) {
          ImmutableSet.Builder<String> builder =
              ImmutableSet.builderWithExpectedSize(newHashSet(elements).size());
          for (String e : elements) {
            builder.add(e);
          }
          return builder.build();
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  3. guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java

        @Override
        protected Set<String> create(String[] elements) {
          ImmutableSet.Builder<String> builder =
              ImmutableSet.builderWithExpectedSize(newHashSet(elements).size());
          for (String e : elements) {
            builder.add(e);
          }
          return builder.build();
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  4. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java

        Collections.reverse(list);
        return unsafeDelegateList(list);
      }
    
      public static <E> Builder<E> builder() {
        return new Builder<E>();
      }
    
      public static <E> Builder<E> builderWithExpectedSize(int expectedSize) {
        return new Builder<E>(expectedSize);
      }
    
      public static final class Builder<E> extends ImmutableCollection.Builder<E> {
        private final ArrayList<E> contents;
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jun 14 22:14:46 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/ImmutableSortedSet.java

       * from consumers of {@code ImmutableSortedSet}.
       *
       * @throws UnsupportedOperationException always
       * @deprecated Not supported by ImmutableSortedSet.
       */
      @DoNotCall("Use naturalOrder (which does not accept an expected size)")
      @Deprecated
      public static <E> ImmutableSortedSet.Builder<E> builderWithExpectedSize(int expectedSize) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 39.1K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/ImmutableBiMapTest.java

      }
    
      @GwtIncompatible
      public void testBuilderExactlySizedReusesArray() {
        ImmutableBiMap.Builder<Integer, Integer> builder = ImmutableBiMap.builderWithExpectedSize(10);
        Entry<Integer, Integer>[] builderArray = builder.entries;
        for (int i = 0; i < 10; i++) {
          builder.put(i, i);
        }
        Entry<Integer, Integer>[] builderArrayAfterPuts = builder.entries;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 22.3K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java

      }
    
      @GwtIncompatible
      public void testBuilderExactlySizedReusesArray() {
        ImmutableMap.Builder<Integer, Integer> builder = ImmutableMap.builderWithExpectedSize(10);
        Object[] builderArray = builder.alternatingKeysAndValues;
        for (int i = 0; i < 10; i++) {
          builder.put(i, i);
        }
        Object[] builderArrayAfterPuts = builder.alternatingKeysAndValues;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 36.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/ImmutableListTest.java

          ImmutableList<Integer> unused = builder.build();
        }
      }
    
      @GwtIncompatible
      public void testBuilderExactlySizedReusesArray() {
        ImmutableList.Builder<Integer> builder = ImmutableList.builderWithExpectedSize(10);
        Object[] builderArray = builder.contents;
        for (int i = 0; i < 10; i++) {
          builder.add(i);
        }
        Object[] builderArrayAfterAdds = builder.contents;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 24.1K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/ImmutableBiMap.java

       * but not exactly, the number of entries added to the builder.
       *
       * @since 23.1
       */
      public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
        checkNonnegative(expectedSize, "expectedSize");
        return new Builder<>(expectedSize);
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 21:21:17 UTC 2024
    - 22.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/ImmutableSortedSet.java

       * from consumers of {@code ImmutableSortedSet}.
       *
       * @throws UnsupportedOperationException always
       * @deprecated Not supported by ImmutableSortedSet.
       */
      @DoNotCall("Use naturalOrder (which does not accept an expected size)")
      @Deprecated
      public static <E> ImmutableSortedSet.Builder<E> builderWithExpectedSize(int expectedSize) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 36.9K bytes
    - Viewed (0)
Back to top