Class BinaryComparator


  • public class BinaryComparator
    extends Object
    • Constructor Detail

    • Method Detail

      • equals

        public boolean equals​(Database database,
                              Binary buffer1,
                              byte type1,
                              Binary buffer2,
                              byte type2)
        Compares if two values are the same.
        Parameters:
        buffer1 - First value to compare
        type1 - Type of first value
        buffer2 - Second value to compare
        type2 - Type of second value
        Returns:
        true if they match, otherwise false
      • equals

        public boolean equals​(Object value1,
                              byte type1,
                              Object value2,
                              byte type2)
      • compareTo

        public static int compareTo​(Object a,
                                    Object b)
        Compare 2 values. If strings or byte[] the unsafe native comparator will be used.
      • equals

        public static boolean equals​(Object a,
                                     Object b)
      • equalsString

        public static boolean equalsString​(String buffer1,
                                           String buffer2)
      • equalsBytes

        public static boolean equalsBytes​(byte[] buffer1,
                                          byte[] buffer2)
      • compareBytes

        public static int compareBytes​(byte[] buffer1,
                                       byte[] buffer2)
      • compareBytes

        public int compareBytes​(byte[] buffer1,
                                Binary buffer2)
      • equalsStrings

        public boolean equalsStrings​(Binary buffer1,
                                     Binary buffer2)
      • compare

        public int compare​(Database database,
                           Binary buffer1,
                           byte type1,
                           Binary buffer2,
                           byte type2)
        Compares if two values are the same.
        Parameters:
        buffer1 - First value to compare
        type1 - Type of first value
        buffer2 - Second value to compare
        type2 - Type of second value
        Returns:
        0 if they match, >0 if first value is major than second, <0 in case is minor
      • compare

        public int compare​(Object value1,
                           byte type1,
                           Object value2,
                           byte type2)