Class NumberUtility

java.lang.Object
com.scriptbasic.utility.NumberUtility

public class NumberUtility
extends java.lang.Object
Utility class to compare Number variables, Long or Double.
Author:
Peter Verhas date Jul 21, 2012
  • Method Summary

    Modifier and Type Method Description
    static int compare​(java.lang.Number a, java.lang.Number b)
    Compares the numbers a and b.
    static boolean isPositive​(java.lang.Number a)  

    Methods inherited from class java.lang.Object

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

    • isPositive

      public static boolean isPositive​(java.lang.Number a)
    • compare

      public static int compare​(java.lang.Number a, java.lang.Number b)
      Compares the numbers a and b.
      Parameters:
      a - one of the numbers
      b - the other number
      Returns:
      0 if a == b; 1 if a > b; and -1 if b < a