Class AtomicClassImpl
- All Implemented Interfaces:
AtomicClass
,DataClass
,PropertyHandler
- Direct Known Subclasses:
BooleanClassImpl
,ByteArrayClassImpl
,ChronologicClassImpl
,NumericClassImpl
,StringClassImpl
,URIClassImpl
- Author:
- Rainer Maximini
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.AtomicClass
CLASS_NAME, LOG_CANNOT_HANDLE_NATIVE_VALUES, LOG_INTERVAL_BORDERS_INCOMPATIBLE, LOG_PARSING_NATIVE_VALUE, LOG_UNKNOWN_NATIVE_VALUE, LOG_UNKNOWN_VALUE_IN_ORDER, LOG_VALUE_RANGE_INCOMPATIBLE
Fields inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
CLASS_NAME, LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE, LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED, LOG_CLASS_NOT_EDITABLE, LOG_CLASS_NOT_INSTANTIABLE, LOG_EDITABLE_CLASS_NOT_INSTANTIABLE, LOG_FINISH_EDIT_FAILED, LOG_GET_SUPERCLASSES_FAILED, LOG_SUBCLASS_CREATION_FAILED
-
Constructor Summary
ModifierConstructorDescriptionConstructor for AtomicClassImpl.protected
AtomicClassImpl
(String name) Constructor for AtomicClassImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAtomicObject
(AtomicObject atomicObject) addAtomicObject.protected void
This method only checks if it is possible to finish the class and does not change any internal status.Creates a newInstanceEnumerationPredicate
for this class.Creates a newInstanceIntervalPredicate
for this class.createNewInstanceOntologyOrderPredicate.createNewInstanceTaxonomyOrderPredicate.createNewInstanceTotalOrderPredicate.protected void
createSystemSubClasses.void
To instantiate classes it is necessary to know if the class can be edited further.getAtomicObjects.The default value is either a defined value withAtomicClass.setDefaultValue(Object)
or an arbitrary but valid one.getInstanceEnumerationPredicate.getInstanceIntervalPredicate.getInstanceOntologyOrderPredicate.Returns the instance predicate that is defined in the atomic classgetInstanceTaxonomyOrderPredicate.getInstanceTotalOrderPredicate.protected Object
getInternalDefaultValue.protected AtomicObject
getNativeValueFromPredicate.boolean
Checks if anInstancePredicate
is defined and if the predicate is anInstanceEnumerationPredicate
.boolean
Checks if anInstancePredicate
is defined and if the predicate is anInstanceIntervalPredicate
.boolean
hasTaxonomyRange.boolean
hasTotalOrderRange.boolean
isAtomic()
isAtomic.nativeFromString
(String value) Converts a String to the native object of the correspondingAtomicObject
nativeToString
(Object value) Converts a native object of the correspondingAtomicObject
to a String.Removes a definedInstancePredicate
from the atomic class.void
setDefaultValue
(Object defaultValue) Each AtomicClass contains a default value that is used to initialize anAtomicObject
.Methods inherited from class de.uni_trier.wi2.procake.data.model.impl.AbstractDataClassImpl
addProperty, addProperty, addSubclass, addSubClass, beSystemClass, checkEditability, checkInstantiability, clearSubClasses, createSubclass, createSystemClassTree, getAllProperties, getAllPropertyNodes, getModel, getName, getObjectClass, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, getRootClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, hasProperties, includeClass, isAbstract, isAdaptationCase, isAggregate, isBoolean, isByteArray, isCake2DataReference, isChronologic, isCollection, isControlflowItem, isDataflowWrapper, isDate, isDouble, isEditable, isInstantiable, isInteger, isInterval, isList, isNESTAdaptationQuery, isNESTAdaptationRule, isNESTAdaptationSession, isNESTAdaptationStep, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTGraphItem, isNESTNode, isNESTPartOfEdge, isNESTQuery, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isParentItem, isSequence, isSet, isString, isSubclassOf, isSubWorkflow, isSystemClass, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, isWorkflowCase, isWorkflowItem, newObject, removeProperty, removeSubclass, removeSubClass, setAbstract, setName, setPropertyRootNode, setSuperClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
addSubclass, checkInstantiability, createSubclass, getModel, getName, getObjectClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, includeClass, isAbstract, isAggregate, isBoolean, isByteArray, isCake2DataReference, isChronologic, isCollection, isControlflowItem, isDataflowWrapper, isDate, isDouble, isEditable, isInstantiable, isInteger, isInterval, isList, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTGraphItem, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isParentItem, isSequence, isSet, isString, isSubclassOf, isSubWorkflow, isSystemClass, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, isWorkflowItem, newObject, removeSubclass, setAbstract, setName
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty, setPropertyRootNode
-
Field Details
-
defaultValue
-
-
Constructor Details
-
AtomicClassImpl
public AtomicClassImpl()Constructor for AtomicClassImpl.
-
AtomicClassImpl
Constructor for AtomicClassImpl.
- Parameters:
name
- aString
object
-
-
Method Details
-
checkFinishEditing
This method only checks if it is possible to finish the class and does not change any internal status. To initialize internal caches use the methodAbstractDataClassImpl.finishEditing()
.Sub classes are allowed to overwrite this method with own code but they must follow some instructions. It is very important to call the
AbstractDataClassImpl.checkFinishEditing()
method in the super class. This can be done before or after the own check methods. But it is advisable to implement the methods like inAbstractDataClassImpl.finishEditing()
where first the super class is called. For example:protected void checkFinishEditing() throws ClassHierarchyConsistencyException { super.checkFinishEditing(); // put your code here }
- Overrides:
checkFinishEditing
in classAbstractDataClassImpl
- Throws:
ClassHierarchyConsistencyException
- See Also:
-
createNewInstanceEnumerationPredicate
public InstanceEnumerationPredicate createNewInstanceEnumerationPredicate() throws IllegalEditExceptionCreates a new
InstanceEnumerationPredicate
for this class. The predicate is automitcally assigned. If a predicate is already defined, it will be removed and replaced with the new one.After creation the old instance predicate is no longer available. If it is needed call the
getInstancePredicate()
method first. *- Specified by:
createNewInstanceEnumerationPredicate
in interfaceAtomicClass
- Returns:
- The new instance of InstanceEnumerationPredicate.
- Throws:
IllegalEditException
-
createNewInstanceIntervalPredicate
Creates a newInstanceIntervalPredicate
for this class. The predicate is automatically assigned. If a predicate is already defined, it will be removed and replaced with the new one.After creation the old instance predicate is no longer available. If it is needed call the
getInstancePredicate()
method first.- Specified by:
createNewInstanceIntervalPredicate
in interfaceAtomicClass
- Returns:
- The new instance of InstanceIntervalPredicate.
- Throws:
IllegalEditException
-
createNewInstanceTaxonomyOrderPredicate
public InstanceTaxonomyOrderPredicate createNewInstanceTaxonomyOrderPredicate() throws IllegalEditExceptioncreateNewInstanceTaxonomyOrderPredicate.
- Specified by:
createNewInstanceTaxonomyOrderPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceTaxonomyOrderPredicate
object - Throws:
IllegalEditException
- if any.
-
createNewInstanceTotalOrderPredicate
public InstanceTotalOrderPredicate createNewInstanceTotalOrderPredicate() throws IllegalEditExceptioncreateNewInstanceTotalOrderPredicate.
- Specified by:
createNewInstanceTotalOrderPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceTotalOrderPredicate
object - Throws:
IllegalEditException
- if any.
-
createNewInstanceOntologyOrderPredicate
public InstanceOntologyOrderPredicate createNewInstanceOntologyOrderPredicate() throws IllegalEditExceptioncreateNewInstanceOntologyOrderPredicate.
- Specified by:
createNewInstanceOntologyOrderPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceOntologyOrderPredicate
object - Throws:
IllegalEditException
- if any.
-
createSystemSubClasses
protected void createSystemSubClasses()createSystemSubClasses.
- Specified by:
createSystemSubClasses
in classAbstractDataClassImpl
-
finishEditing
To instantiate classes it is necessary to know if the class can be edited further. Only finished classes can be instantiated. Therefore, it is necessary to call this method to tell the system that the class is ready defined. Nevertheless, finishing a class can fail because of an inconsistency in the class hierarchy. One of the superclasses is not consistence with this class.The finishing process is distinguished into two parts:
- it is checked if it is possible to finish the class
- the class is finished
Therefore, the method
AbstractDataClassImpl.finishEditing()
first calls the methodAbstractDataClassImpl.checkFinishEditing()
. Sub classes can overwrite both methods but must follow the instructions describe now.Sub classes are allowed to overwrite this method to initialize the class, e.g., create internal caches. But the methods must first call the method
AbstractDataClassImpl.finishEditing()
in the super class. For example:public void finishEditing() throws ClassHierarchyConsistencyException { super.finishEditing(); // put your own finishing code here }
- Specified by:
finishEditing
in interfaceDataClass
- Overrides:
finishEditing
in classAbstractDataClassImpl
- Throws:
ClassHierarchyConsistencyException
- if any.- See Also:
-
getDefaultValue
The default value is either a defined value withAtomicClass.setDefaultValue(Object)
or an arbitrary but valid one.If the class is not finished, null will return if no default one defined manually. After finishing the class an arbitrary valid value is returned.
This must be overwritten by subclasses!
- Specified by:
getDefaultValue
in interfaceAtomicClass
- Returns:
- A valid native object of the class.
- See Also:
-
setDefaultValue
Each AtomicClass contains a default value that is used to initialize anAtomicObject
. This method is optional and must not be specified.- Specified by:
setDefaultValue
in interfaceAtomicClass
- Parameters:
defaultValue
- The initiale value of a newAtomicObject
- Throws:
IllegalEditException
-
getInstancePredicate
Returns the instance predicate that is defined in the atomic class- Specified by:
getInstancePredicate
in interfaceAtomicClass
- Returns:
- InstancePredicate the defined predicate or
null
if no one is defined. - See Also:
-
getInstanceEnumerationPredicate
getInstanceEnumerationPredicate.
- Specified by:
getInstanceEnumerationPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceEnumerationPredicate
object
-
getInstanceIntervalPredicate
getInstanceIntervalPredicate.
- Specified by:
getInstanceIntervalPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceIntervalPredicate
object
-
getInstanceTaxonomyOrderPredicate
getInstanceTaxonomyOrderPredicate.
- Specified by:
getInstanceTaxonomyOrderPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceTaxonomyOrderPredicate
object
-
getInstanceTotalOrderPredicate
getInstanceTotalOrderPredicate.
- Specified by:
getInstanceTotalOrderPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceTotalOrderPredicate
object
-
getInstanceOntologyOrderPredicate
getInstanceOntologyOrderPredicate.
- Specified by:
getInstanceOntologyOrderPredicate
in interfaceAtomicClass
- Returns:
- a
InstanceOntologyOrderPredicate
object
-
getInternalDefaultValue
getInternalDefaultValue.
- Returns:
- a
Object
object
-
getNativeValueFromPredicate
getNativeValueFromPredicate.
- Returns:
- a
AtomicObject
object
-
hasEnumerationRange
public boolean hasEnumerationRange()Checks if anInstancePredicate
is defined and if the predicate is anInstanceEnumerationPredicate
.- Specified by:
hasEnumerationRange
in interfaceAtomicClass
- Returns:
true
ifAtomicClass.getInstancePredicate()
is notnull
and an instance ofInstanceEnumerationPredicate
.
-
hasIntervalRange
public boolean hasIntervalRange()Checks if anInstancePredicate
is defined and if the predicate is anInstanceIntervalPredicate
.- Specified by:
hasIntervalRange
in interfaceAtomicClass
- Returns:
true
ifAtomicClass.getInstancePredicate()
is notnull
and an instance ofInstanceIntervalPredicate
.
-
hasTaxonomyRange
public boolean hasTaxonomyRange()hasTaxonomyRange.
- Specified by:
hasTaxonomyRange
in interfaceAtomicClass
- Returns:
- a boolean
-
hasTotalOrderRange
public boolean hasTotalOrderRange()hasTotalOrderRange.
- Specified by:
hasTotalOrderRange
in interfaceAtomicClass
- Returns:
- a boolean
-
isAtomic
public boolean isAtomic()isAtomic.
- Specified by:
isAtomic
in interfaceDataClass
- Overrides:
isAtomic
in classAbstractDataClassImpl
- Returns:
true
if the data class can be casted toAtomicClass
-
nativeFromString
Converts a String to the native object of the correspondingAtomicObject
- Specified by:
nativeFromString
in interfaceAtomicClass
- Parameters:
value
- The String representation of the value- Returns:
- a new Object representing the
value
- Throws:
InvalidNativeValueException
-
nativeToString
Converts a native object of the correspondingAtomicObject
to a String.- Specified by:
nativeToString
in interfaceAtomicClass
- Parameters:
value
- The native object that should be converted.- Returns:
- a String representation of the
value
- Throws:
InvalidNativeValueException
-
removeInstancePredicate
Removes a definedInstancePredicate
from the atomic class.- Specified by:
removeInstancePredicate
in interfaceAtomicClass
- Returns:
- Returns the removed instance predicate or
null
if none was defined. - Throws:
IllegalEditException
-
addAtomicObject
addAtomicObject.
- Specified by:
addAtomicObject
in interfaceAtomicClass
- Parameters:
atomicObject
- aAtomicObject
object
-
getAtomicObjects
getAtomicObjects.
- Specified by:
getAtomicObjects
in interfaceAtomicClass
- Returns:
- a
LinkedList
object
-