Class UncopiedElementsContainer
- java.lang.Object
-
- net.ssehub.easy.varModel.model.rewrite.UncopiedElementsContainer
-
class UncopiedElementsContainer extends java.lang.ObjectStores elements of theProjectCopyVisitor, 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 Classes Modifier and Type Class Description (package private) static classUncopiedElementsContainer.UnresolvedAnnotationAssignmentContainer for holdingAttributeAssignment.Assignment, which could not copied so far.(package private) static classUncopiedElementsContainer.UnresolvedSyntaxContainerFallback for resolving elements containing constraint syntax trees This container is a tuple of (translated parent, original default value).
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<OperationDefinition>incompleteOperationsOperationDefinitions, which are copied (also its parameter and so on), but of which theCustomOperationcould not be copied due the nestedConstraintSyntaxTree.private java.util.Set<OperationDefinition>notCopiedOperationsOperationDefinitions, which are not copied due to missing dependencies, i.e., types.private java.util.Set<CompoundAccessStatement>uncopiedCompoundAccessesSet ofCompoundAccessStatements which could not be translated because the compound variable was not copied so far.private java.util.Set<FreezeBlock>uncopiedFreezeBlocksSet ofFreezeBlocks which could not be translated as some frozen elements or theFreezeBlock.getSelector()could not be translated.private java.util.Set<UncopiedElementsContainer.UnresolvedSyntaxContainer>uncopyableCSTsSet of copiedAbstractVariables, and their default values.private java.util.Set<Attribute>unresolvedAnnotationsSet of (original) annotations, which could not be translated so far.private java.util.Set<UncopiedElementsContainer.UnresolvedAnnotationAssignment>unresolvedAssignmentsSet of (copied parent, original assignment) forAttributeAssignment.Assignments, which could not be copied so far.private java.util.Set<CustomDatatype>unresolvedDatatypesSet of custom data types which are dependent of other custom data types, not translated so far.private java.util.Set<AbstractVariable>unresolvedDeclarationsAbstractVariables which could not be translated due to a missing data type.private java.util.Set<ProjectInterface>unresolvedInterfacesSet of (original)ProjectInterfaces, which could not be copied as some of the exported declarations are not already copied.
-
Constructor Summary
Constructors Constructor Description UncopiedElementsContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddAll(java.util.List<UncopiedElement> unrelsovedElements, java.util.Collection<? extends ContainableModelElement> elementsToAdd)ConvertsContainableModelElements intoUncopiedElements and adds them to unrelsovedElements.(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 nested {@link {@link net.ssehub.easy.varModel.cst.ConstraintSyntaxTree}} could 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) java.util.Set<AbstractVariable>getDeclarationsWithMissingTypes()Returns the set of original declarations, which could not be translated due to missingCustomDatatypes.(package private) java.util.Set<OperationDefinition>getIncompleteOperations()Returns the set of incompletely copiedOperationDefinitions of which the nested {@link {@link net.ssehub.easy.varModel.cst.ConstraintSyntaxTree}} must be corrected.(package private) java.util.Set<UncopiedElementsContainer.UnresolvedAnnotationAssignment>getUncopiedAnnotationAssignments()Returns the set of uncopiedAttributeAssignment.Assignments.(package private) java.util.Set<CompoundAccessStatement>getUncopiedCompoundAccesses()Returns the set ofCompoundAccessStatements, which could not be copied.(package private) java.util.Set<FreezeBlock>getUncopiedFreezeBlocks()Returns the set ofFreezeBlocks, which could not be copied.(package private) java.util.Set<OperationDefinition>getUncopiedOperations()Returns the set ofOperationDefinitions, which could not be copied (also not partially), due to missing types.(package private) java.util.Set<UncopiedElementsContainer.UnresolvedSyntaxContainer>getUncopyableCSTs()Returns the set of uncopied constraint syntax trees.(package private) java.util.List<UncopiedElement>getUnresolvedElements()Maybe called afterProjectCopyVisitor.getCopiedProject()to verify that all elements could successfully be copied.(package private) java.util.Set<ProjectInterface>getUnresolvedProjectInterfaces()Returns the set of uncopied project interfaces, which still has to be copied.(package private) java.util.Set<CustomDatatype>getUnresolvedTypes()Returns the set of all unresolved (original) data types which could not be translated so far.
-
-
-
Field Detail
-
uncopyableCSTs
private java.util.Set<UncopiedElementsContainer.UnresolvedSyntaxContainer> 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
private java.util.Set<AbstractVariable> unresolvedDeclarations
AbstractVariables which could not be translated due to a missing data type.
-
unresolvedDatatypes
private java.util.Set<CustomDatatype> unresolvedDatatypes
Set of custom data types which are dependent of other custom data types, not translated so far.
-
unresolvedAnnotations
private java.util.Set<Attribute> unresolvedAnnotations
Set of (original) annotations, which could not be translated so far.
-
unresolvedInterfaces
private java.util.Set<ProjectInterface> unresolvedInterfaces
Set of (original)ProjectInterfaces, which could not be copied as some of the exported declarations are not already copied.
-
incompleteOperations
private java.util.Set<OperationDefinition> incompleteOperations
OperationDefinitions, which are copied (also its parameter and so on), but of which theCustomOperationcould not be copied due the nestedConstraintSyntaxTree.
-
notCopiedOperations
private java.util.Set<OperationDefinition> notCopiedOperations
OperationDefinitions, which are not copied due to missing dependencies, i.e., types.
-
uncopiedFreezeBlocks
private java.util.Set<FreezeBlock> uncopiedFreezeBlocks
Set ofFreezeBlocks which could not be translated as some frozen elements or theFreezeBlock.getSelector()could not be translated. Contains the original elements.
-
uncopiedCompoundAccesses
private java.util.Set<CompoundAccessStatement> uncopiedCompoundAccesses
Set ofCompoundAccessStatements which could not be translated because the compound variable was not copied so far.
-
unresolvedAssignments
private java.util.Set<UncopiedElementsContainer.UnresolvedAnnotationAssignment> unresolvedAssignments
Set of (copied parent, original assignment) forAttributeAssignment.Assignments, which could not be copied so far.
-
-
Method Detail
-
addUnresolvedType
void addUnresolvedType(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.- Parameters:
unresolvedType- The unresolved data type, which still has to be translated.
-
getUnresolvedTypes
java.util.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
void addUnresolvedAnnotation(Attribute originalAttribute)
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
void addUnresolvedDeclarationType(AbstractVariable declWithUnresolvedType)
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
java.util.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
void addUnresolvedProjectInterface(ProjectInterface orgInterface)
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
java.util.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
void addIncompleteOperation(OperationDefinition incompleteOperation)
Adds a copiedOperationDefinition, of which the nested {@link {@link net.ssehub.easy.varModel.cst.ConstraintSyntaxTree}} could not be copied.- Parameters:
incompleteOperation- The incompleteOperationDefinitionof which the cst must be fixed at a later time.
-
getIncompleteOperations
java.util.Set<OperationDefinition> getIncompleteOperations()
Returns the set of incompletely copiedOperationDefinitions of which the nested {@link {@link net.ssehub.easy.varModel.cst.ConstraintSyntaxTree}} must be corrected.- Returns:
- The set of incomplete
OperationDefinitions.
-
addUnCopiedOperation
void addUnCopiedOperation(OperationDefinition notCopiedOperation)
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
java.util.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
void addFreezeBlock(FreezeBlock notCopiedBlock)
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
java.util.Set<FreezeBlock> getUncopiedFreezeBlocks()
Returns the set ofFreezeBlocks, which could not be copied.- Returns:
- The set original
FreezeBlocks which still have to be copied.
-
addCompoundAccess
void addCompoundAccess(CompoundAccessStatement notCopiedCompoundAccess)
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
java.util.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
java.util.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
void addUncopyableCST(ContainableModelElement copiedParent, ConstraintSyntaxTree originalCST)
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
java.util.Set<UncopiedElementsContainer.UnresolvedSyntaxContainer> getUncopyableCSTs()
Returns the set of uncopied constraint syntax trees.- Returns:
- tuple of (copied parent (AbstractVariable or Constraint), original CST)
-
getUnresolvedElements
java.util.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(java.util.List<UncopiedElement> unrelsovedElements, java.util.Collection<? extends ContainableModelElement> elementsToAdd)
ConvertsContainableModelElements intoUncopiedElements and adds them to unrelsovedElements. Part ofgetUnresolvedElements().- Parameters:
unrelsovedElements- The list where to add the elements.elementsToAdd- An attribute of this class, maybe empty.
-
-