Class 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
    • 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 path
      CategoryPath 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 category
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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 interface java.lang.Comparable<CategoryPath>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object