Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 36 for expectedSize (0.16 sec)

  1. android/guava/src/com/google/common/collect/Sets.java

       *     without resizing
       * @throws IllegalArgumentException if {@code expectedSize} is negative
       */
      @SuppressWarnings("NonApiType") // acts as a direct substitute for a constructor call
      public static <E extends @Nullable Object> HashSet<E> newHashSetWithExpectedSize(
          int expectedSize) {
        return new HashSet<>(Maps.capacity(expectedSize));
      }
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 81.6K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/CompactHashMap.java

       *
       * @param expectedSize the initial capacity of this {@code CompactHashMap}.
       */
      CompactHashMap(int expectedSize) {
        init(expectedSize);
      }
    
      /** Pseudoconstructor for serialization support. */
      void init(int expectedSize) {
        Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0");
    
        // Save expectedSize for use in allocArrays()
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 35.7K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java

          map.put(1, Integer.toString(1));
          assertThat(map.needsAllocArrays()).isFalse();
          int expectedSize = max(1, i);
          assertThat(map.entries).hasLength(expectedSize);
          assertThat(map.keys).hasLength(expectedSize);
          assertThat(map.values).hasLength(expectedSize);
          assertThat(map.links).hasLength(expectedSize);
        }
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  4. guava/src/com/google/common/io/ByteStreams.java

      static byte[] toByteArray(InputStream in, long expectedSize) throws IOException {
        checkArgument(expectedSize >= 0, "expectedSize (%s) must be non-negative", expectedSize);
        if (expectedSize > MAX_ARRAY_LEN) {
          throw new OutOfMemoryError(expectedSize + " bytes is too large to fit in a byte array");
        }
    
        byte[] bytes = new byte[(int) expectedSize];
        int remaining = (int) expectedSize;
    
        while (remaining > 0) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 17 15:26:41 UTC 2025
    - 31.1K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.expectedSize(8).create();
        assertEquals(8, queue.capacity());
        checkUnbounded(queue);
        checkNatural(queue);
      }
    
      public void testCreation_expectedSize_comparator() {
        MinMaxPriorityQueue<Integer> queue =
            MinMaxPriorityQueue.orderedBy(SOME_COMPARATOR).expectedSize(8).create();
        assertEquals(8, queue.capacity());
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 36K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ImmutableMap.java

       * @since 23.1
       */
      public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
        checkNonnegative(expectedSize, "expectedSize");
        return new Builder<>(expectedSize);
      }
    
      static void checkNoConflict(
          boolean safe, String conflictDescription, Object entry1, Object entry2) {
        if (!safe) {
          throw conflictException(conflictDescription, entry1, entry2);
        }
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 41.2K bytes
    - Viewed (0)
  7. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java

      }
    
      public static <K, V> Builder<K, V> builder() {
        return new Builder<K, V>();
      }
    
      public static <K, V> Builder<K, V> builderWithExpectedSize(int expectedSize) {
        return new Builder<K, V>(expectedSize);
      }
    
      static <K, V> Entry<K, V> entryOf(K key, V value) {
        checkEntryNotNull(key, value);
        return Maps.immutableEntry(key, value);
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 16.7K bytes
    - Viewed (0)
  8. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableList.java

        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;
    
        public Builder() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/AbstractTableReadTest.java

       * @throws ClassCastException if a data element has the wrong type
       */
      protected abstract Table<String, Integer, C> create(@Nullable Object... data);
    
      protected void assertSize(int expectedSize) {
        assertEquals(expectedSize, table.size());
      }
    
      @Override
      public void setUp() throws Exception {
        super.setUp();
        table = create();
      }
    
      public void testContains() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/ImmutableSetMultimap.java

        }
    
        @Override
        ImmutableCollection.Builder<V> newValueCollectionBuilderWithExpectedSize(int expectedSize) {
          return (valueComparator == null)
              ? ImmutableSet.builderWithExpectedSize(expectedSize)
              : new ImmutableSortedSet.Builder<V>(valueComparator, expectedSize);
        }
    
        @Override
        int expectedValueCollectionSize(int defaultExpectedValues, Iterable<?> values) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 25.8K bytes
    - Viewed (0)
Back to top