Class ByteComparisons

java.lang.Object
io.deephaven.util.compare.ByteComparisons

public class ByteComparisons extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    compare(byte lhs, byte rhs)
    Compares two bytes according to the following rules: QueryConstants.NULL_BYTE is less than all other byte values Otherwise, normal byte comparison logic is used
    static boolean
    eq(byte lhs, byte rhs)
    Compare two bytes for equality consistent with compare(byte, byte); that is compare(lhs, rhs) == 0 ⇒ eq(lhs, rhs) and compare(lhs, rhs) != 0 ⇒ !eq(lhs, rhs).
    static boolean
    geq(byte lhs, byte rhs)
    Logically equivalent to compare(lhs, rhs) >= 0.
    static boolean
    gt(byte lhs, byte rhs)
    Logically equivalent to compare(lhs, rhs) > 0.
    static int
    hashCode(byte x)
    Returns a hash code for a byte value consistent with eq(byte, byte); that is, eq(x, y) ⇒ hashCode(x) == hashCode(y).
    static boolean
    leq(byte lhs, byte rhs)
    Logically equivalent to compare(lhs, rhs) <= 0.
    static boolean
    lt(byte lhs, byte rhs)
    Logically equivalent to compare(lhs, rhs) < 0.

    Methods inherited from class java.lang.Object

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

    • ByteComparisons

      public ByteComparisons()
  • Method Details

    • compare

      public static int compare(byte lhs, byte rhs)
      Compares two bytes according to the following rules:
      Parameters:
      lhs - the first value
      rhs - the second value
      Returns:
      the value 0 if lhs is equal to rhs; a value less than 0 if lhs is less than rhs; and a value greater than 0 if lhs is greater than rhs
    • eq

      public static boolean eq(byte lhs, byte rhs)
      Compare two bytes for equality consistent with compare(byte, byte); that is compare(lhs, rhs) == 0 ⇒ eq(lhs, rhs) and compare(lhs, rhs) != 0 ⇒ !eq(lhs, rhs).

      Logically equivalent to compare(lhs, rhs) == 0.

      Parameters:
      lhs - the first value
      rhs - the second value
      Returns:
      true if the values are equal, false otherwise
    • hashCode

      public static int hashCode(byte x)
      Returns a hash code for a byte value consistent with eq(byte, byte); that is, eq(x, y) ⇒ hashCode(x) == hashCode(y).
      Parameters:
      x - the value to hash
      Returns:
      a hash code value for a byte value
    • gt

      public static boolean gt(byte lhs, byte rhs)
      Logically equivalent to compare(lhs, rhs) > 0.
      Parameters:
      lhs - the first value
      rhs - the second value
      Returns:
      true iff lhs is greater than rhs
    • lt

      public static boolean lt(byte lhs, byte rhs)
      Logically equivalent to compare(lhs, rhs) < 0.
      Parameters:
      lhs - the first value
      rhs - the second value
      Returns:
      true iff lhs is less than rhs
    • geq

      public static boolean geq(byte lhs, byte rhs)
      Logically equivalent to compare(lhs, rhs) >= 0.
      Parameters:
      lhs - the first value
      rhs - the second value
      Returns:
      true iff lhs is greater than or equal to rhs
    • leq

      public static boolean leq(byte lhs, byte rhs)
      Logically equivalent to compare(lhs, rhs) <= 0.
      Parameters:
      lhs - the first value
      rhs - the second value
      Returns:
      true iff lhs is less than or equal to rhs