Class NumericTypeUtils

java.lang.Object
io.deephaven.util.type.NumericTypeUtils

public class NumericTypeUtils extends Object
  • Method Details

    • isBoxedNumeric

      public static boolean isBoxedNumeric(@NotNull @NotNull Class<?> c)
      Whether the class is an instance of Number.
      Parameters:
      c - class
      Returns:
      true if Number.class is assignable from c, false otherwise
    • isNumeric

      public static boolean isNumeric(@NotNull @NotNull Class<?> c)
      Parameters:
      c - class
      Returns:
      true if c is numeric, false otherwise
    • isBigNumeric

      public static boolean isBigNumeric(Class<?> type)
      Whether the class is a BigInteger or BigDecimal
      Parameters:
      type - the class
      Returns:
      true if the type is BigInteger or BigDecimal, false otherwise
    • isChar

      public static boolean isChar(@NotNull @NotNull Class<?> c)
      Whether the class is equal to the char/ Character types.
      Parameters:
      c - class
      Returns:
      true if c is a numeric primitive, false otherwise
    • isIntegral

      public static boolean isIntegral(@NotNull @NotNull Class<?> c)
      Whether the class is equal to one of the 4 integral types: int, long, short, or byte.
      Parameters:
      c - class
      Returns:
      true if c is a numeric primitive, false otherwise
    • isFloat

      public static boolean isFloat(@NotNull @NotNull Class<?> c)
      Whether the class is equal to one of the 2 float primitives: float, double.
      Parameters:
      c - class
      Returns:
      true if c is a numeric primitive, false otherwise
    • isIntegralOrChar

      public static boolean isIntegralOrChar(@NotNull @NotNull Class<?> c)
      Whether the class is an integral or char.
      Parameters:
      c - class
      Returns:
      true if c is a numeric primitive, false otherwise
    • isPrimitiveNumeric

      public static boolean isPrimitiveNumeric(@NotNull @NotNull Class<?> c)
      Whether the class is equal to one of the six numeric primitives: float, double, int, long, short, or byte.
      Parameters:
      c - class
      Returns:
      true if c is a numeric primitive, false otherwise