Class CollectionClassImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.model.impl.AbstractDataClassImpl
-
- de.uni_trier.wi2.procake.data.model.base.impl.CollectionClassImpl
-
- All Implemented Interfaces:
CollectionClass,DataClass,PropertyHandler
- Direct Known Subclasses:
ListClassImpl,SetClassImpl
public class CollectionClassImpl extends AbstractDataClassImpl implements CollectionClass
Implementation ofCollectionClass.- Author:
- Rainer Maximini
-
-
Field Summary
-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.CollectionClass
CLASS_NAME, COMPONENT, COMPONENT_KEY, LOG_INCONSISTENT_ELEMENTCLASS, LOG_MISSING_ELEMENTCLASS
-
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 Constructor Description CollectionClassImpl()Constructor for CollectionClassImpl.CollectionClassImpl(String name)Constructor for CollectionClassImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeSystemClass()beSystemClass.voidcheckFinishEditing()This method only checks if it is possible to finish the class and does not change any internal status.protected voidcreateSystemSubClasses()createSystemSubClasses.DataClassgetElementClass()Each collection can contain elements of one special type.intgetMaxCardinality()getMaxCardinality.intgetMinCardinality()getMinCardinality.booleanincludeClass(DataClass other)This method checks if the data class contains a reference to another data class.booleanisCollection()isCollection.voidsetElementClass(DataClass elementClass)Each collection can contain elements of one special type.voidsetMaxCardinality(int maxCardinality)setMaxCardinality.voidsetMinCardinality(int minCardinality)setMinCardinality.protected voidsetSuperClass(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, 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
-
-
-
-
Method Detail
-
beSystemClass
protected void beSystemClass()
beSystemClass.
- Overrides:
beSystemClassin classAbstractDataClassImpl
-
checkFinishEditing
public 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()
-
createSystemSubClasses
protected void createSystemSubClasses()
createSystemSubClasses.
- Specified by:
createSystemSubClassesin classAbstractDataClassImpl
-
getElementClass
public DataClass getElementClass()
Each collection can contain elements of one special type. This type can be received with this method.If several
DataClasses should be used as type, you must summarize these classes in anUnionClass.- Specified by:
getElementClassin interfaceCollectionClass- Returns:
- The
DataClassof the elements.
-
setElementClass
public void setElementClass(DataClass elementClass) throws IllegalEditException
Each collection can contain elements of one special type. This type can be received with this method.If several
DataClasses should be used as type, you must summarize these classes in anUnionClass.- Specified by:
setElementClassin interfaceCollectionClass- Parameters:
elementClass- TheDataClassof the collection elements.- Throws:
IllegalEditException- if any.
-
getMaxCardinality
public int getMaxCardinality()
getMaxCardinality.
- Specified by:
getMaxCardinalityin interfaceCollectionClass- Returns:
- the maximum number of elements that are allowed in the
CollectionObject
-
setMaxCardinality
public void setMaxCardinality(int maxCardinality) throws IllegalEditExceptionsetMaxCardinality.
- Specified by:
setMaxCardinalityin 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:
getMinCardinalityin interfaceCollectionClass- Returns:
- the minimum number of elements that are required in the
CollectionObject
-
setMinCardinality
public void setMinCardinality(int minCardinality) throws IllegalEditExceptionsetMinCardinality.
- Specified by:
setMinCardinalityin 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
public boolean includeClass(DataClass other)
This method checks if the data class contains a reference to another data class.Some data classes contain other data classes. For example,
AggregateClasses contain as attribute type other data classes orCollectionClasses 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:
includeClassin interfaceDataClass- Overrides:
includeClassin classAbstractDataClassImpl- Parameters:
other- The data class that has to be checked for references- Returns:
trueif the data class contains a reference to the giveanotherClass.
-
isCollection
public boolean isCollection()
isCollection.
- Specified by:
isCollectionin interfaceDataClass- Overrides:
isCollectionin classAbstractDataClassImpl- Returns:
trueif the data class can be casted toCollectionClass
-
setSuperClass
protected void setSuperClass(AbstractDataClassImpl superClass)
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:
setSuperClassin classAbstractDataClassImpl- Parameters:
superClass- The super class.
-
-