Interface Category

  • All Superinterfaces:
    java.lang.Comparable<Category>

    public interface Category
    extends java.lang.Comparable<Category>
    Each data type resides in a given a category.
    • Method Detail

      • getName

        java.lang.String getName()
        Get the name of this category.
      • getCategories

        Category[] getCategories()
        Get all categories in this category.
        Returns:
        zero-length array if there are no categories
      • getDataTypes

        DataType[] getDataTypes()
        Get all data types in this category.
        Returns:
        zero-length array if there are no data types
      • getDataTypesByBaseName

        java.util.List<DataType> getDataTypesByBaseName​(java.lang.String name)
        Get all data types in this category whose base name matches the base name of the given name. The base name of a name is the first part of the string up to where the first ".conflict" occurs. In other words, finds all data types whose name matches the given name once any conflict suffixes have been removed from both the given name and the data types that are being scanned.
        Parameters:
        name - the name for which to get conflict related data types in this category. Note: the name that is passed in will be normalized to its base name, so you may pass in names with .conflict appended as a convenience.
        Returns:
        a list of data types that have the same base name as the base name of the given name
      • addDataType

        DataType addDataType​(DataType dt,
                             DataTypeConflictHandler handler)
        Adds the given datatype to this category.
        Parameters:
        dt - the datatype to add to this category.
        handler - the DataTypeConflictHandler to use if conflicts are discovered.
        Returns:
        the new datatype with its category path adjusted.
      • getCategory

        Category getCategory​(java.lang.String name)
        Get a category with the given name.
        Parameters:
        name - the name of the category
        Returns:
        null if there is no category by this name
      • getCategoryPath

        CategoryPath getCategoryPath()
        return the full CategoryPath for this category.
        Returns:
        the full CategoryPath for this category.
      • getDataType

        DataType getDataType​(java.lang.String name)
        Get a data type with the given name.
        Parameters:
        name - the name of the data type
        Returns:
        null if there is no data type by this name
      • createCategory

        Category createCategory​(java.lang.String name)
                         throws InvalidNameException
        Create a category with the given name; if category already exists, then return that category.
        Parameters:
        name - the category name
        Throws:
        InvalidNameException - if name has invalid characters
      • removeCategory

        boolean removeCategory​(java.lang.String name,
                               TaskMonitor monitor)
        Remove the named category from this category.
        Parameters:
        name - the name of the category to remove
        monitor - the task monitor
        Returns:
        true if the category was removed
      • removeEmptyCategory

        boolean removeEmptyCategory​(java.lang.String name,
                                    TaskMonitor monitor)
        Remove the named category from this category, IFF it is empty.
        Parameters:
        name - the name of the category to remove
        monitor - the task monitor
        Returns:
        true if the category was removed
      • moveCategory

        void moveCategory​(Category category,
                          TaskMonitor monitor)
                   throws DuplicateNameException
        Move the given category to this category; category is removed from its original parent category.
        Parameters:
        category - the category to move
        Throws:
        DuplicateNameException - if this category already contains a category or data type with the same name as the category param.
      • copyCategory

        Category copyCategory​(Category category,
                              DataTypeConflictHandler handler,
                              TaskMonitor monitor)
        Make a new subcategory from the given category.
        Parameters:
        category - the category to copy into this category
        Returns:
        category that is added to this category
      • getParent

        Category getParent()
        Return this category's parent; return null if this is the root category.
      • isRoot

        boolean isRoot()
        Returns true if this is the root category.
        Returns:
        true if this is the root category.
      • getCategoryPathName

        java.lang.String getCategoryPathName()
        Get the fully qualified name for this category.
      • getRoot

        Category getRoot()
        Get the root category.
      • getDataTypeManager

        DataTypeManager getDataTypeManager()
        Get the data type manager associated with this category.
      • remove

        boolean remove​(DataType type,
                       TaskMonitor monitor)
        Remove a datatype from this category
        Parameters:
        type - data type to be removed
        monitor - monitor of progress in case operation takes a long time.
        Returns:
        true if the data type was found in this category and successfully removed.
      • getID

        long getID()
        Get the ID for this category.