org.mycore.datamodel.classifications2
Interface MCRCategory

All Known Implementing Classes:
MCRAbstractCategoryImpl, MCRCategoryImpl

public interface MCRCategory

Since:
2.0
Version:
$Revision: 14437 $ $Date: 2008-11-18 15:39:31 +0100 (Di, 18 Nov 2008) $
Author:
Thomas Scheffler (yagee)

Method Summary
 List<MCRCategory> getChildren()
          Returns a list of subcategories.
 MCRLabel getCurrentLabel()
           
 MCRCategoryID getId()
           
 MCRLabel getLabel(String lang)
           
 Collection<MCRLabel> getLabels()
           
 int getLevel()
          Returns the hierarchie level of this category.
 MCRCategory getParent()
          Returns the parent element
 MCRCategory getRoot()
          Returns root category (the classification).
 URI getURI()
          Returns the URI associated with this category.
 boolean hasChildren()
          Tells if this category has subcategories.
 boolean isCategory()
           
 boolean isClassification()
           
 void setId(MCRCategoryID id)
           
 void setURI(URI uri)
           
 

Method Detail

isClassification

boolean isClassification()
Returns:
true if this is a root category

isCategory

boolean isCategory()
Returns:
true if this is not a root category
See Also:
isClassification()

hasChildren

boolean hasChildren()
Tells if this category has subcategories.

Returns:
true if this category has subcategories
See Also:
getChildren()

getChildren

List<MCRCategory> getChildren()
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.

Returns:
subcategories
See Also:
hasChildren()

getId

MCRCategoryID getId()
Returns:
the id

setId

void setId(MCRCategoryID id)
Parameters:
id - the id to set

getLabels

Collection<MCRLabel> getLabels()
Returns:
the labels

getCurrentLabel

MCRLabel getCurrentLabel()
Returns:
the label in the current language (if available), default language (if available) or any other language

getLabel

MCRLabel getLabel(String lang)
Returns:
the label in the specified language (if available) or null

getLevel

int getLevel()
Returns the hierarchie level of this category.

Returns:
0 if this is the root category

getRoot

MCRCategory getRoot()
Returns root category (the classification).

Returns:
the root category

getParent

MCRCategory getParent()
Returns the parent element

Returns:
the categories parent or null if isClassification()==true or category currently not attached

getURI

URI getURI()
Returns the URI associated with this category.

Returns:
the URI

setURI

void setURI(URI uri)
Parameters:
uri - the URI to set