Class SleighUtil
- java.lang.Object
-
- ghidra.app.plugin.assembler.sleigh.util.SleighUtil
-
public class SleighUtil extends java.lang.Object
Utilities forCollection
s
-
-
Constructor Summary
Constructors Constructor Description SleighUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
compareArrays(byte[] a, byte[] b)
Compare two byte arrays by their corresponding entries If the two arrays have differing lengths, the shorter precedes the longer.static <T extends java.lang.Comparable<T>>
intcompareInOrder(java.util.Collection<T> a, java.util.Collection<T> b)
Compare two collections by their corresponding elements in order If the collections have differing sizes, the ordering does not matter.
-
-
-
Method Detail
-
compareInOrder
public static <T extends java.lang.Comparable<T>> int compareInOrder(java.util.Collection<T> a, java.util.Collection<T> b)
Compare two collections by their corresponding elements in order If the collections have differing sizes, the ordering does not matter. The smaller collection precedes the larger. Otherwise, each corresponding pair of elements are compared. Once an unequal pair is found, the collections are ordered by those elements. This is analogous toString
comparison.- Parameters:
a
- the first setb
- the second set- Returns:
- a comparison result as in
Comparable.compareTo(Object)
-
compareArrays
public static int compareArrays(byte[] a, byte[] b)
Compare two byte arrays by their corresponding entries If the two arrays have differing lengths, the shorter precedes the longer. Otherwise, they are compared as in C'smemcmp
, except that Javabyte
s are signed.- Parameters:
a
- the first arrayb
- the second array- Returns:
- a comparison result as in
Comparable.compareTo(Object)
-
-