Package ghidra.program.model.data
Class CategoryPath
- java.lang.Object
-
- ghidra.program.model.data.CategoryPath
-
- All Implemented Interfaces:
java.lang.Comparable<CategoryPath>
public class CategoryPath extends java.lang.Object implements java.lang.Comparable<CategoryPath>
A category path is the full path to a particular data type
-
-
Field Summary
Fields Modifier and Type Field Description static char
DELIMITER_CHAR
static java.lang.String
DELIMITER_STRING
static CategoryPath
ROOT
-
Constructor Summary
Constructors Constructor Description CategoryPath(CategoryPath parent, java.lang.String name)
Create a category path given a parent category and name.CategoryPath(java.lang.String path)
Create a category path given a string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(CategoryPath otherPath)
boolean
equals(java.lang.Object obj)
java.lang.String
getName()
Return the name of this category pathCategoryPath
getParent()
Return the parent category path.java.lang.String
getPath()
Return the full path to the category including the category name as a string.java.lang.String[]
getPathElements()
int
hashCode()
boolean
isAncestorOrSelf(CategoryPath categoryPath)
Tests if the specified categoryPath is the same as, or an ancestor of, this category path.boolean
isRoot()
Determine if this category path corresponds to the root categoryjava.lang.String
toString()
-
-
-
Field Detail
-
DELIMITER_CHAR
public static final char DELIMITER_CHAR
- See Also:
- Constant Field Values
-
DELIMITER_STRING
public static final java.lang.String DELIMITER_STRING
- See Also:
- Constant Field Values
-
ROOT
public static final CategoryPath ROOT
-
-
Constructor Detail
-
CategoryPath
public CategoryPath(java.lang.String path)
Create a category path given a string.- Parameters:
path
- category path string.
-
CategoryPath
public CategoryPath(CategoryPath parent, java.lang.String name)
Create a category path given a parent category and name.- Parameters:
parent
- parent category this path will reside in.name
- name of the category within the parent category.
-
-
Method Detail
-
isRoot
public boolean isRoot()
Determine if this category path corresponds to the root category- Returns:
- true if this is a root category path
-
getName
public java.lang.String getName()
Return the name of this category path
-
getPath
public java.lang.String getPath()
Return the full path to the category including the category name as a string.
-
getParent
public CategoryPath getParent()
Return the parent category path.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isAncestorOrSelf
public boolean isAncestorOrSelf(CategoryPath categoryPath)
Tests if the specified categoryPath is the same as, or an ancestor of, this category path.- Parameters:
categoryPath
- the category path to be checked.- Returns:
- true if the given path is the same as, or an ancestor of, this category path.
-
getPathElements
public java.lang.String[] getPathElements()
-
compareTo
public int compareTo(CategoryPath otherPath)
- Specified by:
compareTo
in interfacejava.lang.Comparable<CategoryPath>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-