Class ComparePrimitives

java.lang.Object
com.illumon.iris.libs.primitives.ComparePrimitives

public class ComparePrimitives extends Object
A set of commonly used functions for comparing primitive pairs.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte
    max(byte v1, byte v2)
    Returns the maximum.
    static double
    max(byte v1, double v2)
    Returns the maximum.
    static float
    max(byte v1, float v2)
    Returns the maximum.
    static int
    max(byte v1, int v2)
    Returns the maximum.
    static long
    max(byte v1, long v2)
    Returns the maximum.
    static short
    max(byte v1, short v2)
    Returns the maximum.
    static double
    max(double v1, byte v2)
    Returns the maximum.
    static double
    max(double v1, double v2)
    Returns the maximum.
    static double
    max(double v1, float v2)
    Returns the maximum.
    static double
    max(double v1, int v2)
    Returns the maximum.
    static double
    max(double v1, long v2)
    Returns the maximum.
    static double
    max(double v1, short v2)
    Returns the maximum.
    static float
    max(float v1, byte v2)
    Returns the maximum.
    static double
    max(float v1, double v2)
    Returns the maximum.
    static float
    max(float v1, float v2)
    Returns the maximum.
    static double
    max(float v1, int v2)
    Returns the maximum.
    static double
    max(float v1, long v2)
    Returns the maximum.
    static float
    max(float v1, short v2)
    Returns the maximum.
    static int
    max(int v1, byte v2)
    Returns the maximum.
    static double
    max(int v1, double v2)
    Returns the maximum.
    static double
    max(int v1, float v2)
    Returns the maximum.
    static int
    max(int v1, int v2)
    Returns the maximum.
    static long
    max(int v1, long v2)
    Returns the maximum.
    static int
    max(int v1, short v2)
    Returns the maximum.
    static long
    max(long v1, byte v2)
    Returns the maximum.
    static double
    max(long v1, double v2)
    Returns the maximum.
    static double
    max(long v1, float v2)
    Returns the maximum.
    static long
    max(long v1, int v2)
    Returns the maximum.
    static long
    max(long v1, long v2)
    Returns the maximum.
    static long
    max(long v1, short v2)
    Returns the maximum.
    static short
    max(short v1, byte v2)
    Returns the maximum.
    static double
    max(short v1, double v2)
    Returns the maximum.
    static float
    max(short v1, float v2)
    Returns the maximum.
    static int
    max(short v1, int v2)
    Returns the maximum.
    static long
    max(short v1, long v2)
    Returns the maximum.
    static short
    max(short v1, short v2)
    Returns the maximum.
    static byte
    min(byte v1, byte v2)
    Returns the minimum.
    static double
    min(byte v1, double v2)
    Returns the minimum.
    static float
    min(byte v1, float v2)
    Returns the minimum.
    static int
    min(byte v1, int v2)
    Returns the minimum.
    static long
    min(byte v1, long v2)
    Returns the minimum.
    static short
    min(byte v1, short v2)
    Returns the minimum.
    static double
    min(double v1, byte v2)
    Returns the minimum.
    static double
    min(double v1, double v2)
    Returns the minimum.
    static double
    min(double v1, float v2)
    Returns the minimum.
    static double
    min(double v1, int v2)
    Returns the minimum.
    static double
    min(double v1, long v2)
    Returns the minimum.
    static double
    min(double v1, short v2)
    Returns the minimum.
    static float
    min(float v1, byte v2)
    Returns the minimum.
    static double
    min(float v1, double v2)
    Returns the minimum.
    static float
    min(float v1, float v2)
    Returns the minimum.
    static double
    min(float v1, int v2)
    Returns the minimum.
    static double
    min(float v1, long v2)
    Returns the minimum.
    static float
    min(float v1, short v2)
    Returns the minimum.
    static int
    min(int v1, byte v2)
    Returns the minimum.
    static double
    min(int v1, double v2)
    Returns the minimum.
    static double
    min(int v1, float v2)
    Returns the minimum.
    static int
    min(int v1, int v2)
    Returns the minimum.
    static long
    min(int v1, long v2)
    Returns the minimum.
    static int
    min(int v1, short v2)
    Returns the minimum.
    static long
    min(long v1, byte v2)
    Returns the minimum.
    static double
    min(long v1, double v2)
    Returns the minimum.
    static double
    min(long v1, float v2)
    Returns the maximum.
    static long
    min(long v1, int v2)
    Returns the minimum.
    static long
    min(long v1, long v2)
    Returns the minimum.
    static long
    min(long v1, short v2)
    Returns the minimum.
    static short
    min(short v1, byte v2)
    Returns the minimum.
    static double
    min(short v1, double v2)
    Returns the minimum.
    static float
    min(short v1, float v2)
    Returns the minimum.
    static int
    min(short v1, int v2)
    Returns the minimum.
    static long
    min(short v1, long v2)
    Returns the minimum.
    static short
    min(short v1, short v2)
    Returns the minimum.

    Methods inherited from class java.lang.Object

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

    • ComparePrimitives

      public ComparePrimitives()
  • Method Details

    • max

      public static byte max(byte v1, byte v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static short max(byte v1, short v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static int max(byte v1, int v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(byte v1, long v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static float max(byte v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(byte v1, double v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static byte min(byte v1, byte v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static short min(byte v1, short v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static int min(byte v1, int v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(byte v1, long v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static float min(byte v1, float v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(byte v1, double v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static short max(short v1, byte v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static short max(short v1, short v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static int max(short v1, int v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(short v1, long v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static float max(short v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(short v1, double v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static short min(short v1, byte v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static short min(short v1, short v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static int min(short v1, int v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(short v1, long v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static float min(short v1, float v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(short v1, double v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static int max(int v1, byte v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static int max(int v1, short v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static int max(int v1, int v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(int v1, long v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(int v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(int v1, double v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static int min(int v1, byte v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static int min(int v1, short v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static int min(int v1, int v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(int v1, long v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(int v1, float v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(int v1, double v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(long v1, byte v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(long v1, long v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(long v1, int v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static long max(long v1, short v2)
      Returns the maximum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(long v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(long v1, double v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(long v1, byte v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(long v1, long v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(long v1, int v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static long min(long v1, short v2)
      Returns the minimum. Null values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(long v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(long v1, double v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static float max(float v1, byte v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static float max(float v1, short v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(float v1, int v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(float v1, long v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static float max(float v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(float v1, double v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static float min(float v1, byte v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static float min(float v1, short v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(float v1, int v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(float v1, long v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static float min(float v1, float v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(float v1, double v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(double v1, byte v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(double v1, short v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(double v1, int v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(double v1, long v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(double v1, float v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • max

      public static double max(double v1, double v2)
      Returns the maximum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      maximum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(double v1, byte v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(double v1, short v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(double v1, int v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(double v1, long v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(double v1, double v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.
    • min

      public static double min(double v1, float v2)
      Returns the minimum. Null and NaN values are excluded.
      Parameters:
      v1 - first value.
      v2 - second value.
      Returns:
      minimum of the valid input values. If both inputs are invalid, null is returned.