Class NumberUtil

java.lang.Object
org.seppiko.commons.utils.NumberUtil

public class NumberUtil
extends java.lang.Object
Number Util
Author:
Leonard Woo
  • Constructor Summary

    Constructors
    Constructor Description
    NumberUtil()  
  • Method Summary

    Modifier and Type Method Description
    static boolean between​(byte num, byte min, byte max)
    test num between min and max
    static boolean between​(double num, double min, double max)
    test num between min and max
    static boolean between​(float num, float min, float max)
    test num between min and max
    static boolean between​(int num, int min, int max)
    test num between min and max
    static boolean between​(long num, long min, long max)
    test num between min and max
    static boolean between​(short num, short min, short max)
    test num between min and max
    static boolean between​(java.math.BigDecimal num, java.math.BigDecimal min, java.math.BigDecimal max)
    test num between min and max
    static boolean between​(java.math.BigInteger num, java.math.BigInteger min, java.math.BigInteger max)
    test num between min and max
    static boolean isDecimal​(java.lang.String num)
    Test String is decimal
    static boolean isInteger​(java.lang.String num)
    Test String is integer
    static boolean isNumeric​(java.lang.String num)
    Test String is numeric
    static int[] toUnsignedIntArray​(byte[] src)
    byte array to unsigned int array
    static long[] toUnsignedLongArray​(int[] src)
    int array to unsigned long array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NumberUtil

      public NumberUtil()
  • Method Details

    • isNumeric

      public static boolean isNumeric​(java.lang.String num)
      Test String is numeric
      Parameters:
      num - numeric
      Returns:
      true is yes
    • isInteger

      public static boolean isInteger​(java.lang.String num)
      Test String is integer
      Parameters:
      num - numeric
      Returns:
      true is yes
    • isDecimal

      public static boolean isDecimal​(java.lang.String num)
      Test String is decimal
      Parameters:
      num - numeric
      Returns:
      true is yes
    • between

      public static boolean between​(byte num, byte min, byte max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(short num, short min, short max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(int num, int min, int max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(long num, long min, long max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(float num, float min, float max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(double num, double min, double max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(java.math.BigDecimal num, java.math.BigDecimal min, java.math.BigDecimal max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • between

      public static boolean between​(java.math.BigInteger num, java.math.BigInteger min, java.math.BigInteger max)
      test num between min and max
      Parameters:
      num - number
      min - minimum number
      max - maximum number
      Returns:
      true = it is
    • toUnsignedIntArray

      public static int[] toUnsignedIntArray​(byte[] src)
      byte array to unsigned int array
      Parameters:
      src - byte array
      Returns:
      unsigned int array
    • toUnsignedLongArray

      public static long[] toUnsignedLongArray​(int[] src)
      int array to unsigned long array
      Parameters:
      src - int array
      Returns:
      unsigned long array