| 1 19 package org.netbeans.jmiimpl.mof.model; 20 21 import java.util.*; 22 import javax.jmi.model.*; 23 import javax.jmi.reflect.*; 24 25 import org.netbeans.mdr.handlers.InstanceHandler; 26 import org.netbeans.mdr.storagemodel.StorableObject; 27 import org.netbeans.mdr.util.*; 28 29 30 35 public abstract class AssociationEndImpl extends ModelElementImpl implements AssociationEnd { 36 protected AssociationEndImpl(StorableObject storable) { 37 super(storable); 38 } 39 40 public AssociationEnd otherEnd() { 41 _lock(false); 42 try { 43 Namespace container = this.getContainer(); 44 if (container == null) return null; 45 Collection elements = container.getContents(); 46 Object element; 47 48 for (Iterator it = elements.iterator(); it.hasNext();) { 49 element = it.next(); 50 if (element instanceof AssociationEnd && !element.equals(this)) { 51 return (AssociationEnd) element; 52 } 53 } 54 55 return null; 56 } finally { 57 _unlock(); 58 } 59 } 60 61 63 } 64 | Popular Tags |