Class AtomicClassImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.model.impl.AbstractDataClassImpl
-
- de.uni_trier.wi2.procake.data.model.base.impl.AtomicClassImpl
-
- All Implemented Interfaces:
AtomicClass,DataClass,PropertyHandler
- Direct Known Subclasses:
BooleanClassImpl,ByteArrayClassImpl,ChronologicClassImpl,NumericClassImpl,StringClassImpl,URIClassImpl
public class AtomicClassImpl extends AbstractDataClassImpl implements AtomicClass
Description is missing- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectdefaultValue-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.AtomicClass
CLASS_NAME, COMPONENT, COMPONENT_KEY, 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, COMPONENT, COMPONENT_KEY, 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
Constructors Modifier Constructor Description AtomicClassImpl()Constructor for AtomicClassImpl.protectedAtomicClassImpl(String name)Constructor for AtomicClassImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAtomicObject(AtomicObject atomicObject)addAtomicObject.protected voidcheckFinishEditing()This method only checks if it is possible to finish the class and does not change any internal status.InstanceEnumerationPredicatecreateNewInstanceEnumerationPredicate()Creates a newInstanceEnumerationPredicatefor this class.InstanceIntervalPredicatecreateNewInstanceIntervalPredicate()Creates a newInstanceIntervalPredicatefor this class.InstanceOntologyOrderPredicatecreateNewInstanceOntologyOrderPredicate()createNewInstanceOntologyOrderPredicate.InstanceTaxonomyOrderPredicatecreateNewInstanceTaxonomyOrderPredicate()createNewInstanceTaxonomyOrderPredicate.InstanceTotalOrderPredicatecreateNewInstanceTotalOrderPredicate()createNewInstanceTotalOrderPredicate.protected voidcreateSystemSubClasses()createSystemSubClasses.voidfinishEditing()To instantiate classes it is necessary to know if the class can be edited further.LinkedList<AtomicObject>getAtomicObjects()getAtomicObjects.ObjectgetDefaultValue()The default value is either a defined value withAtomicClass.setDefaultValue(Object)or an arbitrary but valid one.InstanceEnumerationPredicategetInstanceEnumerationPredicate()getInstanceEnumerationPredicate.InstanceIntervalPredicategetInstanceIntervalPredicate()getInstanceIntervalPredicate.InstancePredicategetInstancePredicate()Returns the instance predicate that is defined in the atomic classInstanceTaxonomyOrderPredicategetInstanceTaxonomyOrderPredicate()getInstanceTaxonomyOrderPredicate.InstanceTotalOrderPredicategetInstanceTotalOrderPredicate()getInstanceTotalOrderPredicate.protected ObjectgetInternalDefaultValue()getInternalDefaultValue.protected AtomicObjectgetNativeValueFromPredicate()getNativeValueFromPredicate.booleanhasEnumerationRange()Checks if anInstancePredicateis defined and if the predicate is anInstanceEnumerationPredicate.booleanhasIntervalRange()Checks if anInstancePredicateis defined and if the predicate is anInstanceIntervalPredicate.booleanhasTaxonomyRange()hasTaxonomyRange.booleanhasTotalOrderRange()hasTotalOrderRange.booleanisAtomic()isAtomic.ObjectnativeFromString(String value)Converts a String to the native object of the correspondingAtomicObjectStringnativeToString(Object value)Converts a native object of the correspondingAtomicObjectto a String.InstancePredicateremoveInstancePredicate()Removes a definedInstancePredicatefrom the atomic class.voidsetDefaultValue(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, 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
-
-
-
-
Field Detail
-
defaultValue
protected Object defaultValue
-
-
Method Detail
-
checkFinishEditing
protected void checkFinishEditing() throws ClassHierarchyConsistencyExceptionThis 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:
checkFinishEditingin classAbstractDataClassImpl- Throws:
ClassHierarchyConsistencyException- See Also:
AbstractDataClassImpl.finishEditing()
-
createNewInstanceEnumerationPredicate
public InstanceEnumerationPredicate createNewInstanceEnumerationPredicate() throws IllegalEditException
Creates a new
InstanceEnumerationPredicatefor 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:
createNewInstanceEnumerationPredicatein interfaceAtomicClass- Returns:
- The new instance of InstanceEnumerationPredicate.
- Throws:
IllegalEditException
-
createNewInstanceIntervalPredicate
public InstanceIntervalPredicate createNewInstanceIntervalPredicate() throws IllegalEditException
Creates a newInstanceIntervalPredicatefor 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:
createNewInstanceIntervalPredicatein interfaceAtomicClass- Returns:
- The new instance of InstanceIntervalPredicate.
- Throws:
IllegalEditException
-
createNewInstanceTaxonomyOrderPredicate
public InstanceTaxonomyOrderPredicate createNewInstanceTaxonomyOrderPredicate() throws IllegalEditException
createNewInstanceTaxonomyOrderPredicate.
- Specified by:
createNewInstanceTaxonomyOrderPredicatein interfaceAtomicClass- Returns:
- a
InstanceTaxonomyOrderPredicateobject - Throws:
IllegalEditException- if any.
-
createNewInstanceTotalOrderPredicate
public InstanceTotalOrderPredicate createNewInstanceTotalOrderPredicate() throws IllegalEditException
createNewInstanceTotalOrderPredicate.
- Specified by:
createNewInstanceTotalOrderPredicatein interfaceAtomicClass- Returns:
- a
InstanceTotalOrderPredicateobject - Throws:
IllegalEditException- if any.
-
createNewInstanceOntologyOrderPredicate
public InstanceOntologyOrderPredicate createNewInstanceOntologyOrderPredicate() throws IllegalEditException
createNewInstanceOntologyOrderPredicate.
- Specified by:
createNewInstanceOntologyOrderPredicatein interfaceAtomicClass- Returns:
- a
InstanceOntologyOrderPredicateobject - Throws:
IllegalEditException- if any.
-
createSystemSubClasses
protected void createSystemSubClasses()
createSystemSubClasses.
- Specified by:
createSystemSubClassesin classAbstractDataClassImpl
-
finishEditing
public void finishEditing() throws ClassHierarchyConsistencyExceptionTo 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:
finishEditingin interfaceDataClass- Overrides:
finishEditingin classAbstractDataClassImpl- Throws:
ClassHierarchyConsistencyException- if any.- See Also:
DataClass.finishEditing(),AbstractDataClassImpl.checkFinishEditing()
-
getDefaultValue
public Object 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:
getDefaultValuein interfaceAtomicClass- Returns:
- A valid native object of the class.
- See Also:
AtomicClass.getDefaultValue()
-
setDefaultValue
public void setDefaultValue(Object defaultValue) throws IllegalEditException
Each AtomicClass contains a default value that is used to initialize anAtomicObject. This method is optional and must not be specified.- Specified by:
setDefaultValuein interfaceAtomicClass- Parameters:
defaultValue- The initiale value of a newAtomicObject- Throws:
IllegalEditException
-
getInstancePredicate
public InstancePredicate getInstancePredicate()
Returns the instance predicate that is defined in the atomic class- Specified by:
getInstancePredicatein interfaceAtomicClass- Returns:
- InstancePredicate the defined predicate or
nullif no one is defined. - See Also:
InstanceEnumerationPredicate,InstanceIntervalPredicate
-
getInstanceEnumerationPredicate
public InstanceEnumerationPredicate getInstanceEnumerationPredicate()
getInstanceEnumerationPredicate.
- Specified by:
getInstanceEnumerationPredicatein interfaceAtomicClass- Returns:
- a
InstanceEnumerationPredicateobject
-
getInstanceIntervalPredicate
public InstanceIntervalPredicate getInstanceIntervalPredicate()
getInstanceIntervalPredicate.
- Specified by:
getInstanceIntervalPredicatein interfaceAtomicClass- Returns:
- a
InstanceIntervalPredicateobject
-
getInstanceTaxonomyOrderPredicate
public InstanceTaxonomyOrderPredicate getInstanceTaxonomyOrderPredicate()
getInstanceTaxonomyOrderPredicate.
- Specified by:
getInstanceTaxonomyOrderPredicatein interfaceAtomicClass- Returns:
- a
InstanceTaxonomyOrderPredicateobject
-
getInstanceTotalOrderPredicate
public InstanceTotalOrderPredicate getInstanceTotalOrderPredicate()
getInstanceTotalOrderPredicate.
- Specified by:
getInstanceTotalOrderPredicatein interfaceAtomicClass- Returns:
- a
InstanceTotalOrderPredicateobject
-
getInternalDefaultValue
protected Object getInternalDefaultValue()
getInternalDefaultValue.
- Returns:
- a
Objectobject
-
getNativeValueFromPredicate
protected AtomicObject getNativeValueFromPredicate()
getNativeValueFromPredicate.
- Returns:
- a
AtomicObjectobject
-
hasEnumerationRange
public boolean hasEnumerationRange()
Checks if anInstancePredicateis defined and if the predicate is anInstanceEnumerationPredicate.- Specified by:
hasEnumerationRangein interfaceAtomicClass- Returns:
trueifAtomicClass.getInstancePredicate()is notnulland an instance ofInstanceEnumerationPredicate.
-
hasIntervalRange
public boolean hasIntervalRange()
Checks if anInstancePredicateis defined and if the predicate is anInstanceIntervalPredicate.- Specified by:
hasIntervalRangein interfaceAtomicClass- Returns:
trueifAtomicClass.getInstancePredicate()is notnulland an instance ofInstanceIntervalPredicate.
-
hasTaxonomyRange
public boolean hasTaxonomyRange()
hasTaxonomyRange.
- Specified by:
hasTaxonomyRangein interfaceAtomicClass- Returns:
- a boolean
-
hasTotalOrderRange
public boolean hasTotalOrderRange()
hasTotalOrderRange.
- Specified by:
hasTotalOrderRangein interfaceAtomicClass- Returns:
- a boolean
-
isAtomic
public boolean isAtomic()
isAtomic.
- Specified by:
isAtomicin interfaceDataClass- Overrides:
isAtomicin classAbstractDataClassImpl- Returns:
trueif the data class can be casted toAtomicClass
-
nativeFromString
public Object nativeFromString(String value) throws InvalidNativeValueException
Converts a String to the native object of the correspondingAtomicObject- Specified by:
nativeFromStringin interfaceAtomicClass- Parameters:
value- The String representation of the value- Returns:
- a new Object representing the
value - Throws:
InvalidNativeValueException
-
nativeToString
public String nativeToString(Object value) throws InvalidNativeValueException
Converts a native object of the correspondingAtomicObjectto a String.- Specified by:
nativeToStringin interfaceAtomicClass- Parameters:
value- The native object that should be converted.- Returns:
- a String representation of the
value - Throws:
InvalidNativeValueException
-
removeInstancePredicate
public InstancePredicate removeInstancePredicate() throws IllegalEditException
Removes a definedInstancePredicatefrom the atomic class.- Specified by:
removeInstancePredicatein interfaceAtomicClass- Returns:
- Returns the removed instance predicate or
nullif none was defined. - Throws:
IllegalEditException
-
addAtomicObject
public void addAtomicObject(AtomicObject atomicObject)
addAtomicObject.
- Specified by:
addAtomicObjectin interfaceAtomicClass- Parameters:
atomicObject- aAtomicObjectobject
-
getAtomicObjects
public LinkedList<AtomicObject> getAtomicObjects()
getAtomicObjects.
- Specified by:
getAtomicObjectsin interfaceAtomicClass- Returns:
- a
LinkedListobject
-
-