Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for constrainToRange (0.13 sec)

  1. android/guava-tests/test/com/google/common/primitives/CharsTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Chars.constrainToRange((char) 1, (char) 0, (char) 5)).isEqualTo((char) 1);
        assertThat(Chars.constrainToRange((char) 1, (char) 1, (char) 5)).isEqualTo((char) 1);
        assertThat(Chars.constrainToRange((char) 1, (char) 3, (char) 5)).isEqualTo((char) 3);
        assertThat(Chars.constrainToRange((char) 255, (char) 250, (char) 254)).isEqualTo((char) 254);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 25.6K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/DoublesTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Doubles.constrainToRange((double) 1, (double) 0, (double) 5)).isEqualTo((double) 1);
        assertThat(Doubles.constrainToRange((double) 1, (double) 1, (double) 5)).isEqualTo((double) 1);
        assertThat(Doubles.constrainToRange((double) 1, (double) 3, (double) 5)).isEqualTo((double) 3);
        assertThat(Doubles.constrainToRange((double) 0, (double) -5, (double) -1))
            .isEqualTo((double) -1);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 32.2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/primitives/FloatsTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Floats.constrainToRange((float) 1, (float) 0, (float) 5)).isEqualTo((float) 1);
        assertThat(Floats.constrainToRange((float) 1, (float) 1, (float) 5)).isEqualTo((float) 1);
        assertThat(Floats.constrainToRange((float) 1, (float) 3, (float) 5)).isEqualTo((float) 3);
        assertThat(Floats.constrainToRange((float) 0, (float) -5, (float) -1)).isEqualTo((float) -1);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/primitives/IntsTest.java

        assertThat(Ints.constrainToRange((int) 1, (int) 0, (int) 5)).isEqualTo((int) 1);
        assertThat(Ints.constrainToRange((int) 1, (int) 1, (int) 5)).isEqualTo((int) 1);
        assertThat(Ints.constrainToRange((int) 1, (int) 3, (int) 5)).isEqualTo((int) 3);
        assertThat(Ints.constrainToRange((int) 0, (int) -5, (int) -1)).isEqualTo((int) -1);
        assertThat(Ints.constrainToRange((int) 5, (int) 2, (int) 2)).isEqualTo((int) 2);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 29.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/primitives/DoublesTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Doubles.constrainToRange((double) 1, (double) 0, (double) 5)).isEqualTo((double) 1);
        assertThat(Doubles.constrainToRange((double) 1, (double) 1, (double) 5)).isEqualTo((double) 1);
        assertThat(Doubles.constrainToRange((double) 1, (double) 3, (double) 5)).isEqualTo((double) 3);
        assertThat(Doubles.constrainToRange((double) 0, (double) -5, (double) -1))
            .isEqualTo((double) -1);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 32.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/primitives/FloatsTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Floats.constrainToRange((float) 1, (float) 0, (float) 5)).isEqualTo((float) 1);
        assertThat(Floats.constrainToRange((float) 1, (float) 1, (float) 5)).isEqualTo((float) 1);
        assertThat(Floats.constrainToRange((float) 1, (float) 3, (float) 5)).isEqualTo((float) 3);
        assertThat(Floats.constrainToRange((float) 0, (float) -5, (float) -1)).isEqualTo((float) -1);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/primitives/LongsTest.java

        assertThat(Longs.constrainToRange((long) 1, (long) 0, (long) 5)).isEqualTo((long) 1);
        assertThat(Longs.constrainToRange((long) 1, (long) 1, (long) 5)).isEqualTo((long) 1);
        assertThat(Longs.constrainToRange((long) 1, (long) 3, (long) 5)).isEqualTo((long) 3);
        assertThat(Longs.constrainToRange((long) 0, (long) -5, (long) -1)).isEqualTo((long) -1);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 29.8K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/CompactHashSet.java

      void init(int expectedSize) {
        Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0");
    
        // Save expectedSize for use in allocArrays()
        this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE);
      }
    
      /** Returns whether arrays need to be allocated. */
      boolean needsAllocArrays() {
        return table == null;
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 24K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/CompactHashSet.java

      void init(int expectedSize) {
        Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0");
    
        // Save expectedSize for use in allocArrays()
        this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE);
      }
    
      /** Returns whether arrays need to be allocated. */
      boolean needsAllocArrays() {
        return table == null;
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 24.9K bytes
    - Viewed (0)
  10. android/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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Aug 27 16:47:48 UTC 2024
    - 23.9K bytes
    - Viewed (0)
Back to top