svn commit: r13309 - branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: b00__1
Date: 2007-08-13 10:55:56-0700
New Revision: 13309

Modified:
   branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Log:
Implementation of getAssociationEnd()

Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&rev=13309&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&r1=13308&r2=13309
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2007-08-13 10:55:56-0700
@@ -221,9 +221,21 @@
         return ((Property) handle).getAssociation();
     }
 
-    public Object getAssociationEnd(Object classifier, Object association) {
-        throw new NotYetImplementedException();
-
+    public Property getAssociationEnd(Object classifier, Object association) {
+        if (!(classifier instanceof Classifier)) {
+            throw new IllegalArgumentException(
+                    "classifier must be instance of Classifier"); //$NON-NLS-1$
+        }
+        if (!(association instanceof Association)) {
+            throw new IllegalArgumentException(
+                    "association must be instance of Association"); //$NON-NLS-1$
+        }
+        for (Property p : UMLUtil.getOwnedAttributes((Classifier) classifier)) {
+            if (p.getAssociation() == association) {
+                return p;
+            }
+        }
+        return null;
     }
 
     public Collection getAssociationEnds(Object handle) {
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.