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​(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 isNumber​(java.lang.String num)
    Test String is number
    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

  • Method Details

    • isNumber

      public static boolean isNumber​(java.lang.String num)
      Test String is number
      Parameters:
      num - number
      Returns:
      true is yes
    • 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
    • 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