Class NumberUtils

java.lang.Object
com.jeff_media.jefflib.NumberUtils

public class NumberUtils extends Object
Number parsing related methods
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
    static final float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isEqual(double number1, double number2)
     
    static boolean
    isEqual(float number1, float number2)
     
    static boolean
    isInbetweenInclusive(int number, int min, int max)
     
    boolean
    Checks if a given String is an Integer.
    static boolean
    isZero(double number)
    Checks if the given number is close to zero
    static boolean
    isZero(float number)
    Checks if the given number is close to zero
    static boolean
    isZero(Number number)
    Checks if the given number is close to zero
    static boolean
    isZeroOrNegative(double number)
    Checks if the given number is close to or lower than zero
    static boolean
    isZeroOrNegative(float number)
    Checks if the given number is close to or lower than zero
    static boolean
    Checks if the given number is close to or lower than zero
    static boolean
    isZeroOrPositive(double number)
    Checks if the given number is close to or higher than zero
    static boolean
    isZeroOrPositive(float number)
    Checks if the given number is close to or higher than zero
    static boolean
    Checks if the given number is close to or higher than zero
    Returns the given String as Integer, or null if it isn't an Integer.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • isEqual

      public static boolean isEqual(double number1, double number2)
    • isZero

      public static boolean isZero(double number)
      Checks if the given number is close to zero
    • isEqual

      public static boolean isEqual(float number1, float number2)
    • isZero

      public static boolean isZero(float number)
      Checks if the given number is close to zero
    • isZeroOrPositive

      public static boolean isZeroOrPositive(double number)
      Checks if the given number is close to or higher than zero
    • isZeroOrPositive

      public static boolean isZeroOrPositive(float number)
      Checks if the given number is close to or higher than zero
    • isZeroOrPositive

      public static boolean isZeroOrPositive(@Nullable Number number)
      Checks if the given number is close to or higher than zero
    • isZero

      public static boolean isZero(@Nullable Number number)
      Checks if the given number is close to zero
    • isZeroOrNegative

      public static boolean isZeroOrNegative(double number)
      Checks if the given number is close to or lower than zero
    • isZeroOrNegative

      public static boolean isZeroOrNegative(float number)
      Checks if the given number is close to or lower than zero
    • isZeroOrNegative

      public static boolean isZeroOrNegative(@Nullable Number number)
      Checks if the given number is close to or lower than zero
    • isInteger

      public boolean isInteger(String text)
      Checks if a given String is an Integer.
    • parseInteger

      @Nullable public Integer parseInteger(String text)
      Returns the given String as Integer, or null if it isn't an Integer.
    • isInbetweenInclusive

      public static boolean isInbetweenInclusive(int number, int min, int max)