Interface InstanceTaxonomyOrderPredicate
- All Superinterfaces:
InstanceEnumerationPredicate
,InstancePredicate
,InstanceValueOrderPredicate
- All Known Implementing Classes:
InstanceTaxonomyOrderPredicateImpl
A
TaxonomyOrder
orderes the values of a InstanceEnumerationPredicate
in a
taxonomy.
Each Taxonomy contains a root node that must be defined first with the method
addRelation(AtomicObject, AtomicObject)
whereby the first parameter must be
null
. Any further node can be added with this method.
The values must be defined in the InstanceEnumerationPredicate
and are checked during the
finishing process of the corresponding AtomicClass
.
- Author:
- Rainer Maximini
- See Also:
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.InstanceEnumerationPredicate
LOG_SUPER_PREDICATE_MUST_BE_DEFINED_IN_INHERITED_PREDICATE
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
Modifier and TypeMethodDescriptionvoid
addRelation
(AtomicObject father, AtomicObject son) To add a relation to the taxonomy the father and the son must be specified.getAllSons
(AtomicObject father) Returns all sons of the given father.getCommonFather
(AtomicObject[] sons) Determines the common father of all given sons.getCommonFather
(AtomicObject firstSon, AtomicObject secondSon) Determines the common father offirstSon
andsecondSon
.getFather
(AtomicObject son) getFather.getRoot()
getRoot.getSons
(AtomicObject father) Returns all direct sons of the given father.boolean
isChild
(AtomicObject child, AtomicObject father) true
ifchild
is a sub node offather
.void
updateRelation
(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, isInherited, removeValue, setInheritance, updateValue
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstancePredicate
getAtomicClass, holdsFor, isEnumerationPredicate, isIntervalPredicate, isOntologyOrderPredicate, isTaxonomyOrderPredicate, isTotalOrderPredicate
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstanceValueOrderPredicate
contains, getOrderValues, isAfter, isBefore, remove, update
-
Field Details
-
LOG_CHILD_ALREADY_EXISTS
- See Also:
-
LOG_CHILD_NOT_FOUND
- See Also:
-
LOG_ROOT_ALREADY_DEFINED
- See Also:
-
-
Method Details
-
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=null
root node of the taxonomy is defined withson
as root. Only one root can be defined why this method throws anIllegalEditException
if 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:
IllegalEditException
ObjectAlreadyExistsException
- Is thrown when theson
is already in the order.ObjectNotFoundException
- Is thrown when thefather
is not an element of the order.
-
getCommonFather
AtomicObject getCommonFather(AtomicObject firstSon, AtomicObject secondSon) throws ObjectNotFoundException Determines the common father offirstSon
andsecondSon
.- Parameters:
firstSon
- aAtomicObject
objectsecondSon
- aAtomicObject
object- Returns:
- Returns the common father of son
firstSon
andsecondSon
. - Throws:
ObjectNotFoundException
- Is thrown when thefirstSon
or thesecondSon
are not an element of the order.
-
getCommonFather
Determines the common father of all given sons.- Parameters:
sons
- Thesons
whose common father should be returned.- Returns:
- The common father of all sons.
- Throws:
ObjectNotFoundException
- Is thrown when one of thesons
are not an element of the order.
-
getFather
getFather.
- Parameters:
son
- Theson
whose father should be returned.- Returns:
- Returns the father value of the
son
ornull
if the son is root node (getRoot()
) and no father exists. - Throws:
ObjectNotFoundException
- Is thrown when theson
is not an element of the order.
-
getRoot
AtomicObject getRoot()getRoot.
- Returns:
- The root value of the taxonomy or
null
if no root is defined.
-
getSons
Returns all direct sons of the given father. If the taxonomy does not containsfather
orfather == null
aObjectNotFoundException
will be thrown.- Parameters:
father
- Thefather
whose sons should be returned.- Returns:
- All child values of the given father. The result is never be null.
- Throws:
ObjectNotFoundException
- Is thrown when thefather
is not an element of the order.
-
getAllSons
Returns all sons of the given father. If the taxonomy does not containsfather
orfather == null
aObjectNotFoundException
will be thrown.- Parameters:
father
- Thefather
whose sons should be returned.- Returns:
- All child values of the given father. The result is never be null.
- Throws:
ObjectNotFoundException
- Is thrown when thefather
is not an element of the order.
-
isChild
true
ifchild
is a sub node offather
. If the child or father isnull
or not defined the exceptionObjectNotFoundException
is thrown.- Parameters:
child
- aAtomicObject
objectfather
- aAtomicObject
object- Returns:
true
if thechild
is a sub node of thefather
.- Throws:
ObjectNotFoundException
- Is thrown when thechild
or thefather
are 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
, orson
are not an element of the order.
-