Class CollectionClassImpl
- All Implemented Interfaces:
CollectionClass
,DataClass
,PropertyHandler
- Direct Known Subclasses:
ListClassImpl
,SetClassImpl
CollectionClass
.- Author:
- Rainer Maximini
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.CollectionClass
CLASS_NAME, LOG_INCONSISTENT_ELEMENTCLASS, LOG_MISSING_ELEMENTCLASS
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
ConstructorDescriptionConstructor for CollectionClassImpl.CollectionClassImpl
(String name) Constructor for CollectionClassImpl. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
beSystemClass.void
This method only checks if it is possible to finish the class and does not change any internal status.protected void
createSystemSubClasses.Each collection can contain elements of one special type.int
getMaxCardinality.int
getMinCardinality.boolean
includeClass
(DataClass other) This method checks if the data class contains a reference to another data class.boolean
isCollection.void
setElementClass
(DataClass elementClass) Each collection can contain elements of one special type.void
setMaxCardinality
(int maxCardinality) setMaxCardinality.void
setMinCardinality
(int minCardinality) setMinCardinality.protected void
setSuperClass
(AbstractDataClassImpl superClass) This is the last method in the instantiation procedure that can be used for some final initializations.Methods inherited from class de.uni_trier.wi2.procake.data.model.impl.AbstractDataClassImpl
addProperty, addProperty, addSubclass, addSubClass, checkEditability, checkInstantiability, clearSubClasses, createSubclass, createSystemClassTree, finishEditing, getAllProperties, getAllPropertyNodes, getModel, getName, getObjectClass, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, getRootClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, hasProperties, isAbstract, isAdaptationCase, isAggregate, isAtomic, isBoolean, isByteArray, isCake2DataReference, isChronologic, 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, 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, finishEditing, getModel, getName, getObjectClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, isAbstract, isAggregate, isAtomic, isBoolean, isByteArray, isCake2DataReference, isChronologic, 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
-
Constructor Details
-
CollectionClassImpl
public CollectionClassImpl()Constructor for CollectionClassImpl.
-
CollectionClassImpl
Constructor for CollectionClassImpl.
- Parameters:
name
- aString
object
-
-
Method Details
-
beSystemClass
protected void beSystemClass()beSystemClass.
- Overrides:
beSystemClass
in classAbstractDataClassImpl
-
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:
-
createSystemSubClasses
protected void createSystemSubClasses()createSystemSubClasses.
- Specified by:
createSystemSubClasses
in classAbstractDataClassImpl
-
getElementClass
Each collection can contain elements of one special type. This type can be received with this method.If several
DataClass
es should be used as type, you must summarize these classes in anUnionClass
.- Specified by:
getElementClass
in interfaceCollectionClass
- Returns:
- The
DataClass
of the elements.
-
setElementClass
Each collection can contain elements of one special type. This type can be received with this method.If several
DataClass
es should be used as type, you must summarize these classes in anUnionClass
.- Specified by:
setElementClass
in interfaceCollectionClass
- Parameters:
elementClass
- TheDataClass
of the collection elements.- Throws:
IllegalEditException
- if any.
-
getMaxCardinality
public int getMaxCardinality()getMaxCardinality.
- Specified by:
getMaxCardinality
in interfaceCollectionClass
- Returns:
- the maximum number of elements that are allowed in the
CollectionObject
-
setMaxCardinality
setMaxCardinality.
- Specified by:
setMaxCardinality
in interfaceCollectionClass
- Parameters:
maxCardinality
- The maximum number of elements that are allowed in theCollectionObject
.- Throws:
IllegalEditException
- is thrown if the class is not editable, e.g., the class is already declared as finished.
-
getMinCardinality
public int getMinCardinality()getMinCardinality.
- Specified by:
getMinCardinality
in interfaceCollectionClass
- Returns:
- the minimum number of elements that are required in the
CollectionObject
-
setMinCardinality
setMinCardinality.
- Specified by:
setMinCardinality
in interfaceCollectionClass
- Parameters:
minCardinality
- The minimum number of elements that are required in theCollectionObject
.- Throws:
IllegalEditException
- is thrown if the class is not editable, e.g., the class is already declared as finished.
-
includeClass
This method checks if the data class contains a reference to another data class.Some data classes contain other data classes. For example,
AggregateClass
es contain as attribute type other data classes orCollectionClass
es have one element type which is also a data class.To prevent an infinite loop, this method does not recursive navigates through all element classes. Only the element of the class are checked but not, if the elements include the given anotherClass.
- Specified by:
includeClass
in interfaceDataClass
- Overrides:
includeClass
in classAbstractDataClassImpl
- Parameters:
other
- The data class that has to be checked for references- Returns:
true
if the data class contains a reference to the giveanotherClass
.
-
isCollection
public boolean isCollection()isCollection.
- Specified by:
isCollection
in interfaceDataClass
- Overrides:
isCollection
in classAbstractDataClassImpl
- Returns:
true
if the data class can be casted toCollectionClass
-
setSuperClass
This is the last method in the instantiation procedure that can be used for some final initializations. Implementations should first call super.setSuperClass(DataClassImpl) before using own initializations.- Overrides:
setSuperClass
in classAbstractDataClassImpl
- Parameters:
superClass
- The super class.
-