svn commit: r17311 - trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java

Michiel van der Wulp <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2009-09-13 11:04:29-0700
New Revision: 17311

Modified:
   trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java

Log:
The "association" (without plural-"s") of a Classifier returns AssociationEnds according to the UML model.

Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java?view=diff&pathrev=17311&r1=17310&r2=17311
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/internal/ocl/uml14/ModelAccessModelInterpreter.java	2009-09-13 11:04:29-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2008 The Regents of the University of California. All
+// Copyright (c) 2008-2009 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -25,6 +25,7 @@
 package org.argouml.profile.internal.ocl.uml14;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Map;
 
@@ -65,7 +66,7 @@
         }
         
         /* 4.5.2.1 Abstraction */  
-        // TODO investigate: Abstraction.mapping is not in the Model Sybsystem
+        // TODO investigate: Abstraction.mapping is not in the Model Subsystem
 
         /* 4.5.2.3 Association */  
         
@@ -122,7 +123,7 @@
                 
                 // TODO investigate the "unnamed opposite end"
                 
-                // Aditional Operation 4.5.3.3 [1]
+                // Additional Operation 4.5.3.3 [1]
                 if (feature.equals("upperbound")) {
                     return Model.getFacade().getUpper(subject);
                 }
@@ -193,9 +194,8 @@
                             .getFeatures(subject));
                 }
                 if (feature.equals("association")) {
-                    // TODO verify if this is the corrected semantics
                     return new ArrayList<Object>(Model.getFacade()
-                            .getAssociatedClasses(subject));
+                          .getAssociationEnds(subject));
                 }                
                 if (feature.equals("powertypeRange")) {
                     return new HashSet<Object>(Model.getFacade()
@@ -710,11 +710,39 @@
             }
         }                
         
+        /* 4.11.3.5 UseCase */
+        if (Model.getFacade().isAUseCase(subject)) {
+            if (type.equals(".")) {
+                if (feature.equals("specificationPath")) {
+                    /*  The operation specificationPath results in a set containing 
+                     * all surrounding Namespaces that are not instances of
+                     *  Package.
+                     *  specificationPath : Set(Namespace) 
+                     * specificationPath = self.allSurroundingNamespaces->select(n |
+                     *    n.oclIsKindOf(Subsystem) or n.oclIsKindOf(Class))
+                     **/
+                    return Model.getUseCasesHelper().getSpecificationPath(subject);
+                }
+                if (feature.equals("allExtensionPoints")) {
+                    Collection c = Model.getCoreHelper().getAllSupertypes(subject);
+                    Collection result = new ArrayList(Model.getFacade().getExtensionPoints(subject));
+                    for (Object uc : c) {
+                        result.addAll(Model.getFacade().getExtensionPoints(uc));
+                    }
+                    return result;
+                }
+            }
+        }
+        
         /* 4.5.3.2 AssociationClass */
 
         if (Model.getFacade().isAAssociationClass(subject)) {
             if (type.equals(".")) {
                 if (feature.equals("allConnections")) {
+                    /* The operation allConnections results in the set of all 
+                     * AssociationEnds of the AssociationClass, including all
+                     * connections defined by its parent (transitive closure).
+                     */
                     return internalOcl(
                             subject,
                             vt,

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2394327

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.