Class MCRCategoryImpl
java.lang.Object
org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
org.mycore.datamodel.classifications2.impl.MCRCategoryImpl
- All Implemented Interfaces:
Serializable
,MCRCategory
- Since:
- 2.0
- Version:
- $Revision$ $Date$
- Author:
- Thomas Scheffler (yagee)
- See Also:
-
Field Summary
Fields inherited from class org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
childGuard, children, labels, parent, root
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
calculateLeftRightAndLevel
(int leftStart, int levelStart) calculates left and right value throug the subtree rooted atco
.boolean
Returns a list of subcategories.getId()
int
int
getLeft()
int
getLevel()
Returns the hierarchie level of this category.Returns the parent elementint
getRight()
getURI()
Returns the URI associated with this category.boolean
Tells if this category has subcategories.int
hashCode()
void
setCategID
(String categID) void
setChildren
(List<MCRCategory> children) protected void
setChildrenUnlocked
(List<MCRCategory> children) void
setInternalID
(int internalID) void
void
setLeft
(int left) void
setLevel
(int level) void
setRight
(int right) void
setRoot
(MCRCategory root) void
Methods inherited from class org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
getCurrentLabel, getLabel, getRoot, isCategory, isClassification, setId, setParent, setURI, toString
-
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 interfaceMCRCategory
- Returns:
- 0 if this is the root category
-
getId
- Specified by:
getId
in interfaceMCRCategory
- Overrides:
getId
in classMCRAbstractCategoryImpl
- Returns:
- the id
-
getChildren
Description copied from interface:MCRCategory
Returns a list of subcategories. Implementors must never returnnull
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 interfaceMCRCategory
- Overrides:
getChildren
in classMCRAbstractCategoryImpl
- Returns:
- subcategories
- See Also:
-
getLabels
- Specified by:
getLabels
in interfaceMCRCategory
- Overrides:
getLabels
in classMCRAbstractCategoryImpl
- Returns:
- the labels
-
getURI
Description copied from interface:MCRCategory
Returns the URI associated with this category.- Specified by:
getURI
in interfaceMCRCategory
- Overrides:
getURI
in classMCRAbstractCategoryImpl
- Returns:
- the URI
-
getParent
Description copied from interface:MCRCategory
Returns the parent element- Specified by:
getParent
in interfaceMCRCategory
- Overrides:
getParent
in classMCRAbstractCategoryImpl
- 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 interfaceMCRCategory
- Overrides:
hasChildren
in classMCRAbstractCategoryImpl
- Returns:
- true if this category has subcategories
- See Also:
-
setChildren
- Parameters:
children
- the children to set
-
setChildrenUnlocked
- Specified by:
setChildrenUnlocked
in classMCRAbstractCategoryImpl
-
setLabels
- 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
-
calculateLeftRightAndLevel
public int calculateLeftRightAndLevel(int leftStart, int levelStart) calculates left and right value throug the subtree rooted atco
.- Parameters:
leftStart
- this.left will be set to this valuelevelStart
- this.getLevel() will return this value- Returns:
- this.right
-
setInternalID
public void setInternalID(int internalID) - Parameters:
internalID
- the internalID to set
-
setRootID
-
setCategID
-
hashCode
public int hashCode() -
equals
-
getRootID
-