Interface InstanceTaxonomyOrderPredicate
-
- All Superinterfaces:
InstanceEnumerationPredicate
,InstancePredicate
,InstanceValueOrderPredicate
- All Known Implementing Classes:
InstanceTaxonomyOrderPredicateImpl
public interface InstanceTaxonomyOrderPredicate extends InstanceValueOrderPredicate
ATaxonomyOrder
orderes the values of aInstanceEnumerationPredicate
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 benull
. 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 correspondingAtomicClass
.- Author:
- Rainer Maximini
- See Also:
AtomicClass
,InstanceEnumerationPredicate
,InstancePredicate
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT
Component: "cake.data.model" (LogComponentIdentifier.COMPONENT
)static String
COMPONENT_KEY
Component-Key (ValueOrder): "03" (LogComponentIdentifier.COMPONENT_KEY_VALUEORDER
)static String
LOG_CHILD_ALREADY_EXISTS
The specified value is already the child of an other value.static String
LOG_CHILD_NOT_FOUND
The specified child could not be found.static String
LOG_ROOT_ALREADY_DEFINED
The 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 void
addRelation(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.AtomicObject
getCommonFather(AtomicObject[] sons)
Determines the common father of all given sons.AtomicObject
getCommonFather(AtomicObject firstSon, AtomicObject secondSon)
Determines the common father offirstSon
andsecondSon
.AtomicObject
getFather(AtomicObject son)
getFather.AtomicObject
getRoot()
getRoot.AtomicObject[]
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, 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=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
AtomicObject getCommonFather(AtomicObject[] sons) throws ObjectNotFoundException
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
AtomicObject getFather(AtomicObject son) throws ObjectNotFoundException
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
AtomicObject[] getSons(AtomicObject father) throws ObjectNotFoundException
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
AtomicObject[] getAllSons(AtomicObject father) throws ObjectNotFoundException
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
boolean isChild(AtomicObject child, AtomicObject father) throws ObjectNotFoundException
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
, otson
are not an element of the order.
-
-