org.mycore.datamodel.classifications2.impl
Class MCRCategoryImpl

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

public class MCRCategoryImpl
extends MCRAbstractCategoryImpl
implements Serializable

Since:
2.0
Version:
$Revision: 15496 $ $Date: 2009-07-10 16:28:14 +0200 (Fri, 10 Jul 2009) $
Author:
Thomas Scheffler (yagee)
See Also:
Serialized Form

Field Summary
(package private)  int level
           
 
Fields inherited from class org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
children, childrenLock, labels, parent, root
 
Constructor Summary
MCRCategoryImpl()
           
 
Method Summary
(package private)  int calculateLeftRightAndLevel(int leftStart, int levelStart)
          calculates left and right value throug the subtree rooted at co.
 String getCategID()
           
 int getInternalID()
           
 int getLeft()
           
(package private)  MCRCategoryImpl getLeftSiblingOrOfAncestor()
           
(package private)  MCRCategoryImpl getLeftSiblingOrParent()
           
 int getLevel()
          Returns the hierarchie level of this category.
 int getPositionInParent()
           
 int getRight()
           
(package private)  MCRCategoryImpl getRightSiblingOrOfAncestor()
           
(package private)  MCRCategoryImpl getRightSiblingOrParent()
           
 String getRootID()
           
 boolean hasChildren()
          Tells if this category has subcategories.
 void setCategID(String categID)
           
 void setChildren(List<MCRCategory> children)
           
 void setInternalID(int internalID)
           
 void setLabels(Collection<MCRLabel> labels)
           
 void setLeft(int left)
           
 void setLevel(int level)
           
 void setPositionInParent(int positionInParent)
           
 void setRight(int right)
           
 void setRoot(MCRCategory root)
           
 void setRootID(String rootID)
           
(package private) static Collection<MCRCategoryImpl> wrapCategories(Collection<? extends MCRCategory> categories, MCRCategory parent, MCRCategory root)
           
(package private) static MCRCategoryImpl wrapCategory(MCRCategory category, MCRCategory parent, MCRCategory root)
           
 
Methods inherited from class org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
detachFromParent, getChildren, getCurrentLabel, getId, getLabel, getLabels, getParent, getRoot, getURI, isCategory, isClassification, setId, setParent, setURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

level

int level
Constructor Detail

MCRCategoryImpl

public MCRCategoryImpl()
Method Detail

getLeft

public int getLeft()
Returns:
the left

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

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

getPositionInParent

public int getPositionInParent()
Returns:
the positionInParent

getRight

public int getRight()
Returns:
the right

setChildren

public void setChildren(List<MCRCategory> children)
Specified by:
setChildren in class MCRAbstractCategoryImpl
Parameters:
children - the children to set

setLabels

public void setLabels(Collection<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)

setPositionInParent

public void setPositionInParent(int positionInParent)
Parameters:
positionInParent - the positionInParent to set

setRight

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

setRoot

public void setRoot(MCRCategory root)

wrapCategories

static Collection<MCRCategoryImpl> wrapCategories(Collection<? extends MCRCategory> categories,
                                                  MCRCategory parent,
                                                  MCRCategory root)

wrapCategory

static MCRCategoryImpl wrapCategory(MCRCategory category,
                                    MCRCategory parent,
                                    MCRCategory root)

getLeftSiblingOrOfAncestor

MCRCategoryImpl getLeftSiblingOrOfAncestor()

getLeftSiblingOrParent

MCRCategoryImpl getLeftSiblingOrParent()

getRightSiblingOrOfAncestor

MCRCategoryImpl getRightSiblingOrOfAncestor()

getRightSiblingOrParent

MCRCategoryImpl getRightSiblingOrParent()

calculateLeftRightAndLevel

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

getInternalID

public int getInternalID()
Returns:
the internalID

setInternalID

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

setRootID

public void setRootID(String rootID)

setCategID

public void setCategID(String categID)

getRootID

public String getRootID()

getCategID

public String getCategID()