Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for expandedCapacity (0.34 sec)

  1. android/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 AssertionError("cannot store more than MAX_VALUE elements");
          }
          // careful of overflow!
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 21.5K bytes
    - Viewed (0)
  2. 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 AssertionError("cannot store more than MAX_VALUE elements");
          }
          // careful of overflow!
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 18.7K bytes
    - Viewed (1)
  3. guava/src/com/google/common/collect/ImmutableSortedSet.java

             * amortized O(n log n) performance.  Therefore, ensure there are at least O(n) *unused*
             * spaces in the builder array.
             */
            int newLength = ImmutableCollection.Builder.expandedCapacity(n, n + 1);
            if (newLength > elements.length) {
              elements = Arrays.copyOf(elements, newLength);
            }
          }
          elements[n++] = element;
          return this;
        }
    
        /**
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 38.5K bytes
    - Viewed (0)
  4. 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);
          }
        }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 35.4K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/ImmutableList.java

          this.size = 0;
        }
    
        private void getReadyToExpandTo(int minCapacity) {
          if (contents.length < minCapacity) {
            this.contents = Arrays.copyOf(contents, expandedCapacity(contents.length, minCapacity));
            forceCopy = false;
          } else if (forceCopy) {
            contents = Arrays.copyOf(contents, contents.length);
            forceCopy = false;
          }
        }
    
        /**
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 30K bytes
    - Viewed (1)
  6. 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;
          }
        }
    
        /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 41.7K bytes
    - Viewed (0)
  7. 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
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 44.1K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/ImmutableSortedMap.java

          this.values = new @Nullable Object[initialCapacity];
        }
    
        private void ensureCapacity(int minCapacity) {
          if (minCapacity > keys.length) {
            int newCapacity = ImmutableCollection.Builder.expandedCapacity(keys.length, minCapacity);
            this.keys = Arrays.copyOf(keys, newCapacity);
            this.values = Arrays.copyOf(values, newCapacity);
          }
        }
    
        /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 53.2K bytes
    - Viewed (0)
Back to top