Class MathUtils

java.lang.Object
org.eclipse.jetty.util.MathUtils

@Deprecated(since="2021-05-27") public class MathUtils extends Object
Deprecated.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    cappedAdd(int a, int b, int maxValue)
    Deprecated.
    Returns the sum of its arguments, capping to maxValue.
    static long
    cappedAdd(long a, long b)
    Deprecated.
    Returns the sum of its arguments, capping to Long.MAX_VALUE if they overflow.
    static boolean
    sumOverflows(int a, int b)
    Deprecated.
    Returns whether the sum of the arguments overflows an int.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • sumOverflows

      public static boolean sumOverflows(int a, int b)
      Deprecated.
      Returns whether the sum of the arguments overflows an int.
      Parameters:
      a - the first value
      b - the second value
      Returns:
      whether the sum of the arguments overflows an int
    • cappedAdd

      public static long cappedAdd(long a, long b)
      Deprecated.
      Returns the sum of its arguments, capping to Long.MAX_VALUE if they overflow.
      Parameters:
      a - the first value
      b - the second value
      Returns:
      the sum of the values, capped to Long.MAX_VALUE
    • cappedAdd

      public static int cappedAdd(int a, int b, int maxValue)
      Deprecated.
      Returns the sum of its arguments, capping to maxValue.
      Parameters:
      a - the first value
      b - the second value
      Returns:
      the sum of the values, capped to maxValue