Class DataTypePath

java.lang.Object
ghidra.program.model.data.DataTypePath
All Implemented Interfaces:
Comparable<DataTypePath>

public class DataTypePath extends Object implements Comparable<DataTypePath>
Object to hold a category path and a datatype name. They are held separately so that the datatype name can contain a categoryPath delimiter ("/") character.
  • Constructor Details

    • DataTypePath

      public DataTypePath(String categoryPath, String dataTypeName)
      Create DatatypePath
      Parameters:
      categoryPath - the category path for the datatype
      dataTypeName - the name of the datatype.
      Throws:
      IllegalArgumentException - if an invalid category path or dataTypeName is given.
    • DataTypePath

      public DataTypePath(CategoryPath categoryPath, String dataTypeName)
      Create DatatypePath
      Parameters:
      categoryPath - the category path for the datatype
      dataTypeName - the name of the datatype.
      Throws:
      IllegalArgumentException - if a null category path or dataTypeName is given.
  • Method Details

    • getCategoryPath

      public CategoryPath getCategoryPath()
      Returns the categoryPath for the datatype represented by this datatype path. (ie. the CategoryPath that contains the DataType that this DataTypePath points to).
      Returns:
      the parent CategoryPath of the DataType that this DataTypePath points to.
    • isAncestor

      public boolean isAncestor(CategoryPath otherCategoryPath)
      Determine if the specified otherCategoryPath is an ancestor of this data type path (i.e., does this data types category or any of its parent hierarchy correspond to the specified categoryPath).
      Parameters:
      otherCategoryPath - category path
      Returns:
      true if otherCategoryPath is an ancestor of this data type path, else false
    • getDataTypeName

      public String getDataTypeName()
      Returns the name of the datatype.
      Returns:
      the name
    • getPath

      public String getPath()
      Returns the full path of this datatype. NOTE: if the datatype name contains any "/" characters, then the resulting path string may be ambiguous as to where the category path ends and the datatype name begins.
      Returns:
      the full path
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(DataTypePath other)
      Specified by:
      compareTo in interface Comparable<DataTypePath>
    • toString

      public String toString()
      Overrides:
      toString in class Object