Class UncopiedElementsContainer
java.lang.Object
net.ssehub.easy.varModel.model.rewrite.UncopiedElementsContainer
Stores elements of the
Each element type is stored in a separate set to facilitate individual treatment and to allow that the elements can be processed in an optimized order.
ProjectCopyVisitor, which could not be copied completely as dependent elements
are not copied, yet. Each element type is stored in a separate set to facilitate individual treatment and to allow that the elements can be processed in an optimized order.
- Author:
- El-Sharkawy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classContainer for holdingAttributeAssignment.Assignment, which could not copied so far.(package private) static classFallback for resolving elements containing constraint syntax trees This container is a tuple of (translated parent, original default value). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Set<OperationDefinition> OperationDefinitions, which are copied (also its parameter and so on), but of which theCustomOperationcould not be copied due the nestedConstraintSyntaxTree.private Set<OperationDefinition> OperationDefinitions, which are not copied due to missing dependencies, i.e., types.private Set<CompoundAccessStatement> Set ofCompoundAccessStatements which could not be translated because the compound variable was not copied so far.private Set<FreezeBlock> Set ofFreezeBlocks which could not be translated as some frozen elements or theFreezeBlock.getSelector()could not be translated.Set of copiedAbstractVariables, and their default values.Set of (original) annotations, which could not be translated so far.Set of (copied parent, original assignment) forAttributeAssignment.Assignments, which could not be copied so far.private Set<CustomDatatype> Set of custom data types which are dependent of other custom data types, not translated so far.private Set<AbstractVariable> AbstractVariables which could not be translated due to a missing data type.private Set<ProjectInterface> Set of (original)ProjectInterfaces, which could not be copied as some of the exported declarations are not already copied. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAll(List<UncopiedElement> unrelsovedElements, Collection<? extends ContainableModelElement> elementsToAdd) (package private) voidaddCompoundAccess(CompoundAccessStatement notCopiedCompoundAccess) Adds an originalCompoundAccessStatement, which could not be copied at all.(package private) voidaddFreezeBlock(FreezeBlock notCopiedBlock) Adds an originalFreezeBlock, which could not be copied at all.(package private) voidaddIncompleteOperation(OperationDefinition incompleteOperation) Adds a copiedOperationDefinition, of which the nestedConstraintSyntaxTreecould not be copied.(package private) voidaddUncopiedAssignment(AttributeAssignment copiedParent, AttributeAssignment.Assignment uncopiedAssignment) Adds anAttributeAssignment.Assignment, which could not be copied so far.(package private) voidaddUnCopiedOperation(OperationDefinition notCopiedOperation) Adds an originalOperationDefinition, which could not be copied at all.(package private) voidaddUncopyableCST(ContainableModelElement copiedParent, ConstraintSyntaxTree originalCST) Adds an CST which could not be copied so far, also not partially.(package private) voidaddUnresolvedAnnotation(Attribute originalAttribute) Adds an annotation, which could not be translated so far (due to missing attributable element or type).(package private) voidaddUnresolvedDeclarationType(AbstractVariable declWithUnresolvedType) Adds anAbstractVariable, which could not be translated so far (due to missing type).(package private) voidaddUnresolvedProjectInterface(ProjectInterface orgInterface) Adds an originalProjectInterface, which could not be copied, as some of the exported declarations are not already copied.(package private) voidaddUnresolvedType(CustomDatatype unresolvedType) Adds a custom data type which could not be translated as it is dependent of another custom data type, which hasn't been copied so far.(package private) Set<AbstractVariable> Returns the set of original declarations, which could not be translated due to missingCustomDatatypes.(package private) Set<OperationDefinition> Returns the set of incompletely copiedOperationDefinitions of which the nestedConstraintSyntaxTreemust be corrected.(package private) Set<UncopiedElementsContainer.UnresolvedAnnotationAssignment> Returns the set of uncopiedAttributeAssignment.Assignments.(package private) Set<CompoundAccessStatement> Returns the set ofCompoundAccessStatements, which could not be copied.(package private) Set<FreezeBlock> Returns the set ofFreezeBlocks, which could not be copied.(package private) Set<OperationDefinition> Returns the set ofOperationDefinitions, which could not be copied (also not partially), due to missing types.(package private) Set<UncopiedElementsContainer.UnresolvedSyntaxContainer> Returns the set of uncopied constraint syntax trees.(package private) List<UncopiedElement> Maybe called afterProjectCopyVisitor.getCopiedProject()to verify that all elements could successfully be copied.(package private) Set<ProjectInterface> Returns the set of uncopied project interfaces, which still has to be copied.(package private) Set<CustomDatatype> Returns the set of all unresolved (original) data types which could not be translated so far.
-
Field Details
-
uncopyableCSTs
Set of copiedAbstractVariables, and their default values. Contrary to unresolvedDefaults, these defaults could not be translated as some data types are still missing. -
unresolvedDeclarations
AbstractVariables which could not be translated due to a missing data type. -
unresolvedDatatypes
Set of custom data types which are dependent of other custom data types, not translated so far. -
unresolvedAnnotations
Set of (original) annotations, which could not be translated so far. -
unresolvedInterfaces
Set of (original)ProjectInterfaces, which could not be copied as some of the exported declarations are not already copied. -
incompleteOperations
OperationDefinitions, which are copied (also its parameter and so on), but of which theCustomOperationcould not be copied due the nestedConstraintSyntaxTree. -
notCopiedOperations
OperationDefinitions, which are not copied due to missing dependencies, i.e., types. -
uncopiedFreezeBlocks
Set ofFreezeBlocks which could not be translated as some frozen elements or theFreezeBlock.getSelector()could not be translated. Contains the original elements. -
uncopiedCompoundAccesses
Set ofCompoundAccessStatements which could not be translated because the compound variable was not copied so far. -
unresolvedAssignments
Set of (copied parent, original assignment) forAttributeAssignment.Assignments, which could not be copied so far.
-
-
Constructor Details
-
UncopiedElementsContainer
UncopiedElementsContainer()
-
-
Method Details
-
addUnresolvedType
Adds a custom data type which could not be translated as it is dependent of another custom data type, which hasn't been copied so far.- Parameters:
unresolvedType- The unresolved data type, which still has to be translated.
-
getUnresolvedTypes
Set<CustomDatatype> getUnresolvedTypes()Returns the set of all unresolved (original) data types which could not be translated so far.- Returns:
- The unresolved data types
-
addUnresolvedAnnotation
Adds an annotation, which could not be translated so far (due to missing attributable element or type).- Parameters:
originalAttribute- The original attribute which could not be translated at this moment.
-
addUnresolvedDeclarationType
Adds anAbstractVariable, which could not be translated so far (due to missing type).- Parameters:
declWithUnresolvedType- The original declaration which could not be translated at this moment.
-
getDeclarationsWithMissingTypes
Set<AbstractVariable> getDeclarationsWithMissingTypes()Returns the set of original declarations, which could not be translated due to missingCustomDatatypes. This set may be changed as a side effect during resolving default values.- Returns:
- Declarations which could not be translated.
-
addUnresolvedProjectInterface
Adds an originalProjectInterface, which could not be copied, as some of the exported declarations are not already copied.- Parameters:
orgInterface- The original project interface, which must be copied at a later point.
-
getUnresolvedProjectInterfaces
Set<ProjectInterface> getUnresolvedProjectInterfaces()Returns the set of uncopied project interfaces, which still has to be copied. This set may be changed as a side effect during successful copying.- Returns:
- The set of outstanding interfaces.
-
addIncompleteOperation
Adds a copiedOperationDefinition, of which the nestedConstraintSyntaxTreecould not be copied.- Parameters:
incompleteOperation- The incompleteOperationDefinitionof which the cst must be fixed at a later time.
-
getIncompleteOperations
Set<OperationDefinition> getIncompleteOperations()Returns the set of incompletely copiedOperationDefinitions of which the nestedConstraintSyntaxTreemust be corrected.- Returns:
- The set of incomplete
OperationDefinitions.
-
addUnCopiedOperation
Adds an originalOperationDefinition, which could not be copied at all.- Parameters:
notCopiedOperation- An original and not copied operation definition, which must be copied at a later time.
-
getUncopiedOperations
Set<OperationDefinition> getUncopiedOperations()Returns the set ofOperationDefinitions, which could not be copied (also not partially), due to missing types. The completeOperationDefinitionmust still be copied.- Returns:
- The set original
OperationDefinitions which still have to be copied.
-
addFreezeBlock
Adds an originalFreezeBlock, which could not be copied at all. This block is depending on uncopied frozen elements or on an uncopyableFreezeBlock.getIter()- Parameters:
notCopiedBlock- An original and not copiedFreezeBlock.
-
getUncopiedFreezeBlocks
Set<FreezeBlock> getUncopiedFreezeBlocks()Returns the set ofFreezeBlocks, which could not be copied.- Returns:
- The set original
FreezeBlocks which still have to be copied.
-
addCompoundAccess
Adds an originalCompoundAccessStatement, which could not be copied at all. This access is depending on aAbstractVariablewhich was not copied so far.- Parameters:
notCopiedCompoundAccess- An original and not copiedCompoundAccessStatement.
-
getUncopiedCompoundAccesses
Set<CompoundAccessStatement> getUncopiedCompoundAccesses()Returns the set ofCompoundAccessStatements, which could not be copied.- Returns:
- The set original
CompoundAccessStatements which still have to be copied.
-
addUncopiedAssignment
void addUncopiedAssignment(AttributeAssignment copiedParent, AttributeAssignment.Assignment uncopiedAssignment) Adds anAttributeAssignment.Assignment, which could not be copied so far.- Parameters:
copiedParent- The already copied parent block for the assignment.uncopiedAssignment- The originalAttributeAssignment.Assignment, which still has to be copied.
-
getUncopiedAnnotationAssignments
Set<UncopiedElementsContainer.UnresolvedAnnotationAssignment> getUncopiedAnnotationAssignments()Returns the set of uncopiedAttributeAssignment.Assignments.- Returns:
- tuple of (copied parent, original assignment) for
AttributeAssignment.Assignments, which could not be copied so far
-
addUncopyableCST
Adds an CST which could not be copied so far, also not partially.- Parameters:
copiedParent- The already copied declaration or constraint to where the cst belongs tooriginalCST- The original syntax, which can not be copied (even partially)
-
getUncopyableCSTs
Set<UncopiedElementsContainer.UnresolvedSyntaxContainer> getUncopyableCSTs()Returns the set of uncopied constraint syntax trees.- Returns:
- tuple of (copied parent (AbstractVariable or Constraint), original CST)
-
getUnresolvedElements
List<UncopiedElement> getUnresolvedElements()Maybe called afterProjectCopyVisitor.getCopiedProject()to verify that all elements could successfully be copied.- Returns:
- A list of failing elements, should be empty if copying was successful.
-
addAll
private void addAll(List<UncopiedElement> unrelsovedElements, Collection<? extends ContainableModelElement> elementsToAdd) ConvertsContainableModelElements intoUncopiedElements and adds them tounrelsovedElements. Part ofgetUnresolvedElements().- Parameters:
unrelsovedElements- The list where to add the elements.elementsToAdd- An attribute of this class, maybe empty.
-