Class MCRCategoryImpl

java.lang.Object
org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
org.mycore.datamodel.classifications2.impl.MCRCategoryImpl
All Implemented Interfaces:
Serializable, MCRCategory

@Entity public class MCRCategoryImpl extends MCRAbstractCategoryImpl implements Serializable
Since:
2.0
Version:
$Revision$ $Date$
Author:
Thomas Scheffler (yagee)
See Also:
  • Constructor Details

    • MCRCategoryImpl

      public MCRCategoryImpl()
  • Method Details

    • getInternalID

      public int getInternalID()
    • getLeft

      public int getLeft()
    • getRight

      public int getRight()
    • getLevel

      public int getLevel()
      Description copied from interface: MCRCategory
      Returns the hierarchie level of this category.
      Specified by:
      getLevel in interface MCRCategory
      Returns:
      0 if this is the root category
    • getId

      public MCRCategoryID getId()
      Specified by:
      getId in interface MCRCategory
      Overrides:
      getId in class MCRAbstractCategoryImpl
      Returns:
      the id
    • getChildren

      public List<MCRCategory> getChildren()
      Description copied from interface: MCRCategory
      Returns a list of subcategories. Implementors must never return null if no children are present. As this method may need a new call the underlaying persistence layer use hasChildren() if you just want to know if subcategories are present. Changes to the list may not affect the underlaying persistence layer.
      Specified by:
      getChildren in interface MCRCategory
      Overrides:
      getChildren in class MCRAbstractCategoryImpl
      Returns:
      subcategories
      See Also:
    • getLabels

      public SortedSet<MCRLabel> getLabels()
      Specified by:
      getLabels in interface MCRCategory
      Overrides:
      getLabels in class MCRAbstractCategoryImpl
      Returns:
      the labels
    • getURI

      public URI getURI()
      Description copied from interface: MCRCategory
      Returns the URI associated with this category.
      Specified by:
      getURI in interface MCRCategory
      Overrides:
      getURI in class MCRAbstractCategoryImpl
      Returns:
      the URI
    • getParent

      public MCRCategory getParent()
      Description copied from interface: MCRCategory
      Returns the parent element
      Specified by:
      getParent in interface MCRCategory
      Overrides:
      getParent in class MCRAbstractCategoryImpl
      Returns:
      the categories parent or null if isClassification()==true or category currently not attached
    • hasChildren

      public boolean hasChildren()
      Description copied from interface: MCRCategory
      Tells if this category has subcategories.
      Specified by:
      hasChildren in interface MCRCategory
      Overrides:
      hasChildren in class MCRAbstractCategoryImpl
      Returns:
      true if this category has subcategories
      See Also:
    • setChildren

      public void setChildren(List<MCRCategory> children)
      Parameters:
      children - the children to set
    • setChildrenUnlocked

      protected void setChildrenUnlocked(List<MCRCategory> children)
      Specified by:
      setChildrenUnlocked in class MCRAbstractCategoryImpl
    • setLabels

      public void setLabels(SortedSet<MCRLabel> labels)
      Parameters:
      labels - the labels to set
    • setLeft

      public void setLeft(int left)
      Parameters:
      left - the left to set
    • setLevel

      public void setLevel(int level)
    • setRight

      public void setRight(int right)
      Parameters:
      right - the right to set
    • setRoot

      public void setRoot(MCRCategory root)
    • calculateLeftRightAndLevel

      public int calculateLeftRightAndLevel(int leftStart, int levelStart)
      calculates left and right value throug the subtree rooted at co.
      Parameters:
      leftStart - this.left will be set to this value
      levelStart - this.getLevel() will return this value
      Returns:
      this.right
    • setInternalID

      public void setInternalID(int internalID)
      Parameters:
      internalID - the internalID to set
    • setRootID

      public void setRootID(String rootID)
    • setCategID

      public void setCategID(String categID)
    • hashCode

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

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

      public String getRootID()