Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 62 for checkNonNegative (0.26 sec)

  1. android/guava-tests/test/com/google/common/math/MathPreconditionsTest.java

        }
      }
    
      public void testCheckNonNegative_zeroInt() {
        MathPreconditions.checkNonNegative("int", 0);
      }
    
      public void testCheckNonNegative_maxInt() {
        MathPreconditions.checkNonNegative("int", Integer.MAX_VALUE);
      }
    
      public void testCheckNonNegative_minInt() {
        try {
          MathPreconditions.checkNonNegative("int", Integer.MIN_VALUE);
          fail();
        } catch (IllegalArgumentException expected) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/DiscreteDomain.java

     * limitations under the License.
     */
    
    package com.google.common.collect;
    
    import static com.google.common.base.Preconditions.checkArgument;
    import static com.google.common.collect.CollectPreconditions.checkNonnegative;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.primitives.Ints;
    import com.google.errorprone.annotations.CanIgnoreReturnValue;
    import java.io.Serializable;
    import java.math.BigInteger;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/math/IntMath.java

         * gcd(0, Integer.MIN_VALUE)? BigInteger.gcd would return positive 2^31, but positive 2^31 isn't
         * an int.
         */
        checkNonNegative("a", a);
        checkNonNegative("b", b);
        if (a == 0) {
          // 0 % b == 0, so b divides a, but the converse doesn't hold.
          // BigInteger.gcd is consistent with this decision.
          return b;
        } else if (b == 0) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/graph/DirectedGraphConnections.java

          int successorCount) {
        this.adjacentNodeValues = checkNotNull(adjacentNodeValues);
        this.orderedNodeConnections = orderedNodeConnections;
        this.predecessorCount = checkNonNegative(predecessorCount);
        this.successorCount = checkNonNegative(successorCount);
        checkState(
            predecessorCount <= adjacentNodeValues.size()
                && successorCount <= adjacentNodeValues.size());
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 18K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/math/MathPreconditionsTest.java

        }
      }
    
      public void testCheckNonNegative_zeroInt() {
        MathPreconditions.checkNonNegative("int", 0);
      }
    
      public void testCheckNonNegative_maxInt() {
        MathPreconditions.checkNonNegative("int", Integer.MAX_VALUE);
      }
    
      public void testCheckNonNegative_minInt() {
        try {
          MathPreconditions.checkNonNegative("int", Integer.MIN_VALUE);
          fail();
        } catch (IllegalArgumentException expected) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/AbstractMapBasedMultiset.java

        checkNonnegative(count, "count");
        int oldCount = (count == 0) ? backingMap.remove(element) : backingMap.put(element, count);
        size += (count - oldCount);
        return oldCount;
      }
    
      @Override
      public final boolean setCount(@ParametricNullness E element, int oldCount, int newCount) {
        checkNonnegative(oldCount, "oldCount");
        checkNonnegative(newCount, "newCount");
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Mar 06 16:06:58 GMT 2023
    - 8.2K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/CollectPreconditions.java

        }
      }
    
      @CanIgnoreReturnValue
      static int checkNonnegative(int value, String name) {
        if (value < 0) {
          throw new IllegalArgumentException(name + " cannot be negative but was: " + value);
        }
        return value;
      }
    
      @CanIgnoreReturnValue
      static long checkNonnegative(long value, String name) {
        if (value < 0) {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Wed Jun 30 10:33:07 GMT 2021
    - 2.1K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/CollectPreconditions.java

        }
      }
    
      @CanIgnoreReturnValue
      static int checkNonnegative(int value, String name) {
        if (value < 0) {
          throw new IllegalArgumentException(name + " cannot be negative but was: " + value);
        }
        return value;
      }
    
      @CanIgnoreReturnValue
      static long checkNonnegative(long value, String name) {
        if (value < 0) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Jun 30 10:33:07 GMT 2021
    - 2.1K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/math/MathPreconditions.java

        }
        return x;
      }
    
      @CanIgnoreReturnValue
      static int checkNonNegative(String role, int x) {
        if (x < 0) {
          throw new IllegalArgumentException(role + " (" + x + ") must be >= 0");
        }
        return x;
      }
    
      @CanIgnoreReturnValue
      static long checkNonNegative(String role, long x) {
        if (x < 0) {
          throw new IllegalArgumentException(role + " (" + x + ") must be >= 0");
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  10. guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java

         * @throws IllegalArgumentException if {@code oldCount} or {@code newCount} is negative
         */
        @Override
        public boolean setCount(E element, int oldCount, int newCount) {
          checkNonnegative(oldCount, "oldCount");
          checkNonnegative(newCount, "newCount");
          if (newCount == 0) {
            if (oldCount == 0) {
              // No change to make, but must return true if the element is not present
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed May 09 15:17:25 GMT 2018
    - 16.6K bytes
    - Viewed (0)
Back to top