Package ghidra.trace.model.target.path
Enum Class KeyPath.KeyComparator
- All Implemented Interfaces:
Serializable,Comparable<KeyPath.KeyComparator>,Constable,Comparator<String>
- Enclosing class:
KeyPath
public static enum KeyPath.KeyComparator
extends Enum<KeyPath.KeyComparator>
implements Comparator<String>
Comparators for keys, i.e., strings in a path
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSort keys by attribute name, lexicographically.Sort keys by element or index as appropriate, placing elements first.Sort keys by element index.Sort keys by element index, allowing only one dimension. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyPath.KeyComparatorReturns the enum constant of this class with the specified name.static KeyPath.KeyComparator[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Enum Constant Details
-
ATTRIBUTE
Sort keys by attribute name, lexicographically. -
ELEMENT
Sort keys by element index.Element indices may be multidimensional, in which case the dimensions are separated by commas, and sorting prioritizes the left-most dimensions. Where indices (or dimensions thereof) appear to be numeric, they are sorted as such. Otherwise, they are sorted lexicographically. Numeric types can be encoded in hexadecimal. While decimal is typical you may run into difficulties if those numbers are too large, as the implementation must assume numeric types are hexadecimal.
- Implementation Notes:
- The only way I can think to resolve the numeric encoding issue is to examine all keys before even selecting a comparator. As is, a comparator can only see two keys at a time, and has no context to what it's actually sorting.
-
ELEMENT_DIM
Sort keys by element index, allowing only one dimension.Please use
ELEMENT, unless you really know you need this instead. -
CHILD
Sort keys by element or index as appropriate, placing elements first.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-