mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-0 - CategoryPath changes
This commit is contained in:
parent
a348f2d5df
commit
2fc8f67835
1 changed files with 9 additions and 9 deletions
|
@ -229,7 +229,7 @@ public class CategoryPath implements Comparable<CategoryPath> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the {@link String} representation of this category path including the category name,
|
* Return the {@link String} representation of this category path including the category name,
|
||||||
* where components are delimited with a forward slash. Any occurance of a forward slash
|
* where components are delimited with a forward slash. Any occurrence of a forward slash
|
||||||
* within individual path components will be escaped (e.g., {@code "\/"}).
|
* within individual path components will be escaped (e.g., {@code "\/"}).
|
||||||
* @return the full category path
|
* @return the full category path
|
||||||
*/
|
*/
|
||||||
|
@ -242,7 +242,7 @@ public class CategoryPath implements Comparable<CategoryPath> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the {@link String} representation of the specified {@code childName} within this
|
* Return the {@link String} representation of the specified {@code childName} within this
|
||||||
* category path where all path components are delimited with a forward slash. Any occurance
|
* category path where all path components are delimited with a forward slash. Any occurrence
|
||||||
* of a forward slash within individual path components, including the {@code childName}, will
|
* of a forward slash within individual path components, including the {@code childName}, will
|
||||||
* be escaped (e.g., {@code "\/"}).
|
* be escaped (e.g., {@code "\/"}).
|
||||||
* @param childName child name
|
* @param childName child name
|
||||||
|
@ -307,7 +307,7 @@ public class CategoryPath implements Comparable<CategoryPath> {
|
||||||
*/
|
*/
|
||||||
public boolean isAncestorOrSelf(CategoryPath candidateAncestorPath) {
|
public boolean isAncestorOrSelf(CategoryPath candidateAncestorPath) {
|
||||||
|
|
||||||
// Result categoryPath This
|
// Result candidateAncestor This
|
||||||
// ------ --------------------- ------------------------
|
// ------ --------------------- ------------------------
|
||||||
// True / /
|
// True / /
|
||||||
// True / /apple
|
// True / /apple
|
||||||
|
@ -344,12 +344,12 @@ public class CategoryPath implements Comparable<CategoryPath> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(CategoryPath other) {
|
public int compareTo(CategoryPath other) {
|
||||||
if (isRoot() && other.isRoot()) {
|
if (isRoot()) {
|
||||||
return 0;
|
return other.isRoot() ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRoot() || other.isRoot()) {
|
if (other.isRoot()) {
|
||||||
return isRoot() ? -1 : 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = parent.compareTo(other.getParent());
|
int result = parent.compareTo(other.getParent());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue