Package com.arcadedb.serializer
Class BinaryComparator
- java.lang.Object
-
- com.arcadedb.serializer.BinaryComparator
-
public class BinaryComparator extends Object
-
-
Constructor Summary
Constructors Constructor Description BinaryComparator(BinarySerializer serializer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Database database, Binary buffer1, byte type1, Binary buffer2, byte type2)
Compares if two values are the same.int
compare(Object value1, byte type1, Object value2, byte type2)
static int
compareBytes(byte[] buffer1, byte[] buffer2)
int
compareBytes(byte[] buffer1, Binary buffer2)
static int
compareTo(Object a, Object b)
Compare 2 values.boolean
equals(Database database, Binary buffer1, byte type1, Binary buffer2, byte type2)
Compares if two values are the same.boolean
equals(Object value1, byte type1, Object value2, byte type2)
static boolean
equals(Object a, Object b)
static boolean
equalsBytes(byte[] buffer1, byte[] buffer2)
static boolean
equalsString(String buffer1, String buffer2)
boolean
equalsStrings(Binary buffer1, Binary buffer2)
-
-
-
Constructor Detail
-
BinaryComparator
public BinaryComparator(BinarySerializer serializer)
-
-
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 comparetype1
- Type of first valuebuffer2
- Second value to comparetype2
- Type of second value- Returns:
- true if they match, otherwise false
-
compareTo
public static int compareTo(Object a, Object b)
Compare 2 values. If strings or byte[] the unsafe native comparator will be used.
-
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)
-
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 comparetype1
- Type of first valuebuffer2
- Second value to comparetype2
- Type of second value- Returns:
- 0 if they match, >0 if first value is major than second, <0 in case is minor
-
-