Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 16 of 16 for constrainToRange (0.36 sec)

  1. android/guava/src/com/google/common/primitives/Shorts.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static short constrainToRange(short value, short min, short max) {
        checkArgument(min <= max, "min (%s) must be less than or equal to max (%s)", min, max);
        return value < min ? min : value < max ? value : max;
      }
    
      /**
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Wed Oct 22 18:14:49 UTC 2025
    - 25.7K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/primitives/Ints.java

       * @since 21.0
       */
      // A call to bare "min" or "max" would resolve to our varargs method, not to any static import.
      @SuppressWarnings("StaticImportPreferred")
      public static int constrainToRange(int value, int min, int max) {
        checkArgument(min <= max, "min (%s) must be less than or equal to max (%s)", min, max);
        return Math.min(Math.max(value, min), max);
      }
    
      /**
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Wed Oct 22 18:14:49 UTC 2025
    - 31.3K bytes
    - Viewed (0)
  3. guava/src/com/google/common/primitives/Chars.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static char constrainToRange(char value, char min, char max) {
        checkArgument(min <= max, "min (%s) must be less than or equal to max (%s)", min, max);
        return value < min ? min : value < max ? value : max;
      }
    
      /**
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 24.2K bytes
    - Viewed (0)
  4. guava/src/com/google/common/primitives/Floats.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static float constrainToRange(float value, float min, float max) {
        // avoid auto-boxing by not using Preconditions.checkArgument(); see Guava issue 3984
        // Reject NaN by testing for the good case (min <= max) instead of the bad (min > max).
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Wed Oct 22 18:14:49 UTC 2025
    - 25.6K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/primitives/Longs.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static long constrainToRange(long value, long min, long max) {
        checkArgument(min <= max, "min (%s) must be less than or equal to max (%s)", min, max);
        return Math.min(Math.max(value, min), max);
      }
    
      /**
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Wed Oct 22 18:14:49 UTC 2025
    - 29K bytes
    - Viewed (0)
  6. guava/src/com/google/common/primitives/Doubles.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static double constrainToRange(double value, double min, double max) {
        // avoid auto-boxing by not using Preconditions.checkArgument(); see Guava issue 3984
        // Reject NaN by testing for the good case (min <= max) instead of the bad (min > max).
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Wed Oct 22 18:14:49 UTC 2025
    - 27.6K bytes
    - Viewed (0)
Back to top