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 charDELIMITER_CHARstatic java.lang.StringDELIMITER_STRINGstatic CategoryPathROOT
-
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 intcompareTo(CategoryPath otherPath)booleanequals(java.lang.Object obj)java.lang.StringgetName()Return the name of this category pathCategoryPathgetParent()Return the parent category path.java.lang.StringgetPath()Return the full path to the category including the category name as a string.java.lang.String[]getPathElements()inthashCode()booleanisAncestorOrSelf(CategoryPath categoryPath)Tests if the specified categoryPath is the same as, or an ancestor of, this category path.booleanisRoot()Determine if this category path corresponds to the root categoryjava.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
compareToin interfacejava.lang.Comparable<CategoryPath>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-