Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for expandedCapacity (0.2 sec)

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

        assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
        assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
        assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
        assertEquals(
            Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
        assertEquals(
            Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
        assertEquals(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 1.5K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java

        assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1));
        assertEquals(2, ImmutableCollection.Builder.expandedCapacity(0, 2));
        assertEquals(2, ImmutableCollection.Builder.expandedCapacity(1, 2));
        assertEquals(
            Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(0, Integer.MAX_VALUE));
        assertEquals(
            Integer.MAX_VALUE, ImmutableCollection.Builder.expandedCapacity(1, Integer.MAX_VALUE));
        assertEquals(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 1.5K bytes
    - Viewed (0)
  3. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableCollection.java

        return false;
      }
    
      /** GWT emulated version of {@link ImmutableCollection.Builder}. */
      public abstract static class Builder<E> {
    
        Builder() {}
    
        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 19 12:43:09 GMT 2024
    - Last Modified: Tue Jan 23 18:43:40 GMT 2024
    - 5K bytes
    - Viewed (0)
  4. 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) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri May 12 16:34:24 GMT 2023
    - 18.9K bytes
    - Viewed (0)
  5. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 21.5K bytes
    - Viewed (0)
  6. android/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) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri May 12 16:34:24 GMT 2023
    - 18.9K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/primitives/ImmutableDoubleArray.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) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri May 12 16:34:24 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top