Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for expandedCapacity (0.07 sec)

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

         * current array, create a new array.
         */
        private void ensureRoomFor(int newElements) {
          @Nullable Object[] contents = this.contents;
          int newCapacity = expandedCapacity(contents.length, size + newElements);
          // expandedCapacity handles the overflow case
          if (newCapacity > contents.length || forceCopy) {
            this.contents = Arrays.copyOf(this.contents, newCapacity);
            forceCopy = false;
          }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 21.4K bytes
    - Viewed (0)
  2. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java

      /** GWT emulated version of {@link ImmutableCollection.Builder}. */
      public abstract static class Builder<E> {
        static final int DEFAULT_INITIAL_CAPACITY = 4;
    
        Builder() {}
    
        static int expandedCapacity(int oldCapacity, int minCapacity) {
          if (minCapacity < 0) {
            throw new AssertionError("cannot store more than MAX_VALUE elements");
          }
          // careful of overflow!
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/primitives/ImmutableLongArray.java

          if (newCount > array.length) {
            array = Arrays.copyOf(array, expandedCapacity(array.length, newCount));
          }
        }
    
        // Unfortunately this is pasted from ImmutableCollection.Builder.
        private static int expandedCapacity(int oldCapacity, int minCapacity) {
          if (minCapacity < 0) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 22K bytes
    - Viewed (0)
  4. guava/src/com/google/common/primitives/ImmutableIntArray.java

          if (newCount > array.length) {
            array = Arrays.copyOf(array, expandedCapacity(array.length, newCount));
          }
        }
    
        // Unfortunately this is pasted from ImmutableCollection.Builder.
        private static int expandedCapacity(int oldCapacity, int minCapacity) {
          if (minCapacity < 0) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 21.4K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/HashBiMap.java

       */
      private void ensureCapacity(int minCapacity) {
        if (nextInBucketKToV.length < minCapacity) {
          int oldCapacity = nextInBucketKToV.length;
          int newCapacity = ImmutableCollection.Builder.expandedCapacity(oldCapacity, minCapacity);
    
          keys = Arrays.copyOf(keys, newCapacity);
          values = Arrays.copyOf(values, newCapacity);
          nextInBucketKToV = expandAndFillWithAbsent(nextInBucketKToV, newCapacity);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 36.2K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/ImmutableCollection.java

       *
       * @since 10.0
       */
      @DoNotMock
      public abstract static class Builder<E> {
        static final int DEFAULT_INITIAL_CAPACITY = 4;
    
        static int expandedCapacity(int oldCapacity, int minCapacity) {
          if (minCapacity < 0) {
            throw new IllegalArgumentException("cannot store more than Integer.MAX_VALUE elements");
          } else if (minCapacity <= oldCapacity) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 18.7K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/ImmutableSet.java

         * elements.
         */
        private void ensureCapacity(int minCapacity) {
          if (minCapacity > dedupedElements.length) {
            int newCapacity =
                ImmutableCollection.Builder.expandedCapacity(dedupedElements.length, minCapacity);
            dedupedElements = Arrays.copyOf(dedupedElements, newCapacity);
          }
        }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 35.2K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/ImmutableMap.java

          if (minCapacity * 2 > alternatingKeysAndValues.length) {
            alternatingKeysAndValues =
                Arrays.copyOf(
                    alternatingKeysAndValues,
                    ImmutableCollection.Builder.expandedCapacity(
                        alternatingKeysAndValues.length, minCapacity * 2));
            entriesUsed = false;
          }
        }
    
        /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 41.2K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/ImmutableMap.java

        }
    
        private void ensureCapacity(int minCapacity) {
          if (minCapacity > entries.length) {
            entries =
                Arrays.copyOf(
                    entries, ImmutableCollection.Builder.expandedCapacity(entries.length, minCapacity));
            entriesUsed = false;
          }
        }
    
        /**
         * Associates {@code key} with {@code value} in the built map. If the same key is put more than
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 44.3K bytes
    - Viewed (0)
Back to top