Class UncopiedElementsContainer

java.lang.Object
net.ssehub.easy.varModel.model.rewrite.UncopiedElementsContainer

class UncopiedElementsContainer extends Object
Stores elements of the 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
  • Field Details

  • Constructor Details

    • UncopiedElementsContainer

      UncopiedElementsContainer()
  • Method Details

    • 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

      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 an AbstractVariable, 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 missing CustomDatatypes. 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 original ProjectInterface, 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

      void addIncompleteOperation(OperationDefinition incompleteOperation)
      Adds a copied OperationDefinition, of which the nested ConstraintSyntaxTree could not be copied.
      Parameters:
      incompleteOperation - The incomplete OperationDefinition of which the cst must be fixed at a later time.
    • getIncompleteOperations

      Set<OperationDefinition> getIncompleteOperations()
      Returns the set of incompletely copied OperationDefinitions of which the nested ConstraintSyntaxTree must be corrected.
      Returns:
      The set of incomplete OperationDefinitions.
    • addUnCopiedOperation

      void addUnCopiedOperation(OperationDefinition notCopiedOperation)
      Adds an original OperationDefinition, 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 of OperationDefinitions, which could not be copied (also not partially), due to missing types. The complete OperationDefinition must still be copied.
      Returns:
      The set original OperationDefinitions which still have to be copied.
    • addFreezeBlock

      void addFreezeBlock(FreezeBlock notCopiedBlock)
      Adds an original FreezeBlock, which could not be copied at all. This block is depending on uncopied frozen elements or on an uncopyable FreezeBlock.getIter()
      Parameters:
      notCopiedBlock - An original and not copied FreezeBlock.
    • getUncopiedFreezeBlocks

      Set<FreezeBlock> getUncopiedFreezeBlocks()
      Returns the set of FreezeBlocks, which could not be copied.
      Returns:
      The set original FreezeBlocks which still have to be copied.
    • addCompoundAccess

      void addCompoundAccess(CompoundAccessStatement notCopiedCompoundAccess)
      Adds an original CompoundAccessStatement, which could not be copied at all. This access is depending on a AbstractVariable which was not copied so far.
      Parameters:
      notCopiedCompoundAccess - An original and not copied CompoundAccessStatement.
    • getUncopiedCompoundAccesses

      Set<CompoundAccessStatement> getUncopiedCompoundAccesses()
      Returns the set of CompoundAccessStatements, 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 an AttributeAssignment.Assignment, which could not be copied so far.
      Parameters:
      copiedParent - The already copied parent block for the assignment.
      uncopiedAssignment - The original AttributeAssignment.Assignment, which still has to be copied.
    • getUncopiedAnnotationAssignments

      Returns the set of uncopied AttributeAssignment.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 to
      originalCST - The original syntax, which can not be copied (even partially)
    • 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 after ProjectCopyVisitor.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)
      Converts ContainableModelElements into UncopiedElements and adds them to unrelsovedElements. Part of getUnresolvedElements().
      Parameters:
      unrelsovedElements - The list where to add the elements.
      elementsToAdd - An attribute of this class, maybe empty.