org.mycore.datamodel.classifications2.impl
Class MCRAbstractCategoryImpl
java.lang.Object
org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
- All Implemented Interfaces:
- MCRCategory
- Direct Known Subclasses:
- MCRCategoryImpl
public abstract class MCRAbstractCategoryImpl
- extends Object
- implements MCRCategory
- Since:
- 2.0
- Version:
- $Revision: 14980 $ $Date: 2009-03-20 14:02:28 +0100 (Fri, 20 Mar 2009) $
- Author:
- Thomas Scheffler (yagee)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
root
protected MCRCategory root
parent
protected MCRCategory parent
labels
protected Collection<MCRLabel> labels
children
protected List<MCRCategory> children
childrenLock
protected final ReentrantReadWriteLock childrenLock
MCRAbstractCategoryImpl
public MCRAbstractCategoryImpl()
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
- Returns:
- subcategories
- See Also:
MCRCategory.hasChildren()
setChildren
protected abstract void setChildren(List<MCRCategory> children)
getId
public MCRCategoryID getId()
- Specified by:
getId in interface MCRCategory
- Returns:
- the id
getLabels
public Collection<MCRLabel> getLabels()
- Specified by:
getLabels in interface MCRCategory
- Returns:
- the labels
getRoot
public MCRCategory getRoot()
- Description copied from interface:
MCRCategory
- Returns root category (the classification).
- Specified by:
getRoot in interface MCRCategory
- Returns:
- the root category
getURI
public URI getURI()
- Description copied from interface:
MCRCategory
- Returns the URI associated with this category.
- Specified by:
getURI in interface MCRCategory
- Returns:
- the URI
hasChildren
public boolean hasChildren()
- Description copied from interface:
MCRCategory
- Tells if this category has subcategories.
- Specified by:
hasChildren in interface MCRCategory
- Returns:
- true if this category has subcategories
- See Also:
MCRCategory.getChildren()
isCategory
public final boolean isCategory()
- Specified by:
isCategory in interface MCRCategory
- Returns:
- true if this is not a root category
- See Also:
MCRCategory.isClassification()
isClassification
public final boolean isClassification()
- Specified by:
isClassification in interface MCRCategory
- Returns:
- true if this is a root category
setId
public void setId(MCRCategoryID id)
- Specified by:
setId in interface MCRCategory
- Parameters:
id - the id to set
setURI
public void setURI(URI uri)
- Specified by:
setURI in interface MCRCategory
- Parameters:
uri - the URI to set
getParent
public MCRCategory getParent()
- Description copied from interface:
MCRCategory
- Returns the parent element
- Specified by:
getParent in interface MCRCategory
- Returns:
- the categories parent or null if isClassification()==true or
category currently not attached
setParent
public void setParent(MCRCategory parent)
detachFromParent
void detachFromParent()
getCurrentLabel
public MCRLabel getCurrentLabel()
- Specified by:
getCurrentLabel in interface MCRCategory
- Returns:
- the label in the current language (if available), default language (if available) or any other language
getLabel
public MCRLabel getLabel(String lang)
- Specified by:
getLabel in interface MCRCategory
- Returns:
- the label in the specified language (if available) or null