Interface InstanceTaxonomyOrderPredicate
-
- All Superinterfaces:
InstanceEnumerationPredicate,InstancePredicate,InstanceValueOrderPredicate
- All Known Implementing Classes:
InstanceTaxonomyOrderPredicateImpl
public interface InstanceTaxonomyOrderPredicate extends InstanceValueOrderPredicate
ATaxonomyOrderorderes the values of aInstanceEnumerationPredicatein a taxonomy.Each Taxonomy contains a root node that must be defined first with the method
addRelation(AtomicObject, AtomicObject)whereby the first parameter must benull. Any further node can be added with this method.The values must be defined in the
InstanceEnumerationPredicateand are checked during the finishing process of the correspondingAtomicClass.- Author:
- Rainer Maximini
- See Also:
AtomicClass,InstanceEnumerationPredicate,InstancePredicate
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENTComponent: "cake.data.model" (LogComponentIdentifier.COMPONENT)static StringCOMPONENT_KEYComponent-Key (ValueOrder): "03" (LogComponentIdentifier.COMPONENT_KEY_VALUEORDER)static StringLOG_CHILD_ALREADY_EXISTSThe specified value is already the child of an other value.static StringLOG_CHILD_NOT_FOUNDThe specified child could not be found.static StringLOG_ROOT_ALREADY_DEFINEDThe order already has a root-node.-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.InstanceValueOrderPredicate
LOG_VALUE_ALREADY_DEFINED, LOG_VALUE_NOT_FOUND, LOG_VALUE_UPDATE_FAILED
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddRelation(AtomicObject father, AtomicObject son)To add a relation to the taxonomy the father and the son must be specified.AtomicObject[]getAllSons(AtomicObject father)Returns all sons of the given father.AtomicObjectgetCommonFather(AtomicObject[] sons)Determines the common father of all given sons.AtomicObjectgetCommonFather(AtomicObject firstSon, AtomicObject secondSon)Determines the common father offirstSonandsecondSon.AtomicObjectgetFather(AtomicObject son)getFather.AtomicObjectgetRoot()getRoot.AtomicObject[]getSons(AtomicObject father)Returns all direct sons of the given father.booleanisChild(AtomicObject child, AtomicObject father)trueifchildis a sub node offather.voidupdateRelation(AtomicObject oldFather, AtomicObject newFather, AtomicObject son)To move a son node with all sub nodes to another father this method can be used.-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstanceEnumerationPredicate
addValue, getValues, hasValueOrder, removeValue, updateValue
-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstancePredicate
getAtomicClass, holdsFor, isEnumerationPredicate, isIntervalPredicate, isTaxonomyOrderPredicate, isTotalOrderPredicate
-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstanceValueOrderPredicate
contains, getOrderValues, isAfter, isBefore, remove, update
-
-
-
-
Field Detail
-
COMPONENT
static final String COMPONENT
Component: "cake.data.model" (LogComponentIdentifier.COMPONENT)- See Also:
- Constant Field Values
-
COMPONENT_KEY
static final String COMPONENT_KEY
Component-Key (ValueOrder): "03" (LogComponentIdentifier.COMPONENT_KEY_VALUEORDER)- See Also:
- Constant Field Values
-
LOG_CHILD_ALREADY_EXISTS
static final String LOG_CHILD_ALREADY_EXISTS
The specified value is already the child of an other value.- Component:
COMPONENT - Key: "0321"
- this
- Present Father
AtomicObject - Value
AtomicObject
- See Also:
- Constant Field Values
- Component:
-
LOG_CHILD_NOT_FOUND
static final String LOG_CHILD_NOT_FOUND
The specified child could not be found.- Component:
COMPONENT - Key: "0320"
- this
- Childname
- See Also:
- Constant Field Values
- Component:
-
LOG_ROOT_ALREADY_DEFINED
static final String LOG_ROOT_ALREADY_DEFINED
The order already has a root-node.- Component:
COMPONENT - Key: "0322"
- this
- Current root-node
AtomicObject
- See Also:
- Constant Field Values
- Component:
-
-
Method Detail
-
addRelation
void addRelation(AtomicObject father, AtomicObject son) throws IllegalEditException, ObjectAlreadyExistsException, ObjectNotFoundException
To add a relation to the taxonomy the father and the son must be specified. Iffather=nullroot node of the taxonomy is defined withsonas root. Only one root can be defined why this method throws anIllegalEditExceptionif a root is already defined. To update the root node the old root must be removedremove(getRoot())first.The relation is only be added if the father is already included in the taxonomy and the son is not included. To change a relation, the
updateRelation(AtomicObject, AtomicObject, AtomicObject)method should be used.- Parameters:
father- the value of the father nodeson- the value of the son node- Throws:
IllegalEditExceptionObjectAlreadyExistsException- Is thrown when thesonis already in the order.ObjectNotFoundException- Is thrown when thefatheris not an element of the order.
-
getCommonFather
AtomicObject getCommonFather(AtomicObject firstSon, AtomicObject secondSon) throws ObjectNotFoundException
Determines the common father offirstSonandsecondSon.- Parameters:
firstSon- aAtomicObjectobjectsecondSon- aAtomicObjectobject- Returns:
- Returns the common father of son
firstSonandsecondSon. - Throws:
ObjectNotFoundException- Is thrown when thefirstSonor thesecondSonare not an element of the order.
-
getCommonFather
AtomicObject getCommonFather(AtomicObject[] sons) throws ObjectNotFoundException
Determines the common father of all given sons.- Parameters:
sons- Thesonswhose common father should be returned.- Returns:
- The common father of all sons.
- Throws:
ObjectNotFoundException- Is thrown when one of thesonsare not an element of the order.
-
getFather
AtomicObject getFather(AtomicObject son) throws ObjectNotFoundException
getFather.
- Parameters:
son- Thesonwhose father should be returned.- Returns:
- Returns the father value of the
sonornullif the son is root node (getRoot()) and no father exists. - Throws:
ObjectNotFoundException- Is thrown when thesonis not an element of the order.
-
getRoot
AtomicObject getRoot()
getRoot.
- Returns:
- The root value of the taxonomy or
nullif no root is defined.
-
getSons
AtomicObject[] getSons(AtomicObject father) throws ObjectNotFoundException
Returns all direct sons of the given father. If the taxonomy does not containsfatherorfather == nullaObjectNotFoundExceptionwill be thrown.- Parameters:
father- Thefatherwhose sons should be returned.- Returns:
- All child values of the given father. The result is never be null.
- Throws:
ObjectNotFoundException- Is thrown when thefatheris not an element of the order.
-
getAllSons
AtomicObject[] getAllSons(AtomicObject father) throws ObjectNotFoundException
Returns all sons of the given father. If the taxonomy does not containsfatherorfather == nullaObjectNotFoundExceptionwill be thrown.- Parameters:
father- Thefatherwhose sons should be returned.- Returns:
- All child values of the given father. The result is never be null.
- Throws:
ObjectNotFoundException- Is thrown when thefatheris not an element of the order.
-
isChild
boolean isChild(AtomicObject child, AtomicObject father) throws ObjectNotFoundException
trueifchildis a sub node offather. If the child or father isnullor not defined the exceptionObjectNotFoundExceptionis thrown.- Parameters:
child- aAtomicObjectobjectfather- aAtomicObjectobject- Returns:
trueif thechildis a sub node of thefather.- Throws:
ObjectNotFoundException- Is thrown when thechildor thefatherare not an element of the order.
-
updateRelation
void updateRelation(AtomicObject oldFather, AtomicObject newFather, AtomicObject son) throws ObjectNotFoundException
To move a son node with all sub nodes to another father this method can be used.- Parameters:
oldFather- The value of the old father that must exist.newFather- The value of the new father that must exist.son- The value of the son that must exist as son of the old father.- Throws:
ObjectNotFoundException- Is thrown when theoldFather, thenewFather, otsonare not an element of the order.
-
-