All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.uml2.uml.internal.impl.RelationshipImpl Maven / Gradle / Ivy

/*
 * Copyright (c) 2005, 2011 IBM Corporation, CEA, and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   IBM - initial API and implementation
 *   Kenn Hussey (CEA) - 327039
 *
 * $Id: RelationshipImpl.java,v 1.13 2007/04/25 17:47:03 khussey Exp $
 */
package org.eclipse.uml2.uml.internal.impl;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.resource.Resource;

import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.common.util.DerivedUnionEObjectEList;

import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Relationship;
import org.eclipse.uml2.uml.UMLPackage;

/**
 * 
 * An implementation of the model object 'Relationship'.
 * 
 * 

* The following features are implemented: *

    *
  • {@link org.eclipse.uml2.uml.internal.impl.RelationshipImpl#getRelatedElements Related Element}
  • *
*

* * @generated */ public abstract class RelationshipImpl extends ElementImpl implements Relationship { /** * * * @generated */ protected RelationshipImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return UMLPackage.Literals.RELATIONSHIP; } /** * * * @generated */ public EList getRelatedElements() { CacheAdapter cache = getCacheAdapter(); if (cache != null) { Resource eResource = eResource(); @SuppressWarnings("unchecked") EList relatedElements = (EList) cache.get( eResource, this, UMLPackage.Literals.RELATIONSHIP__RELATED_ELEMENT); if (relatedElements == null) { cache.put(eResource, this, UMLPackage.Literals.RELATIONSHIP__RELATED_ELEMENT, relatedElements = new DerivedUnionEObjectEList( Element.class, this, UMLPackage.RELATIONSHIP__RELATED_ELEMENT, null)); } return relatedElements; } return new DerivedUnionEObjectEList(Element.class, this, UMLPackage.RELATIONSHIP__RELATED_ELEMENT, null); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case UMLPackage.RELATIONSHIP__EANNOTATIONS : return getEAnnotations(); case UMLPackage.RELATIONSHIP__OWNED_COMMENT : return getOwnedComments(); case UMLPackage.RELATIONSHIP__OWNED_ELEMENT : return getOwnedElements(); case UMLPackage.RELATIONSHIP__OWNER : if (resolve) return getOwner(); return basicGetOwner(); case UMLPackage.RELATIONSHIP__RELATED_ELEMENT : return getRelatedElements(); } return eDynamicGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case UMLPackage.RELATIONSHIP__EANNOTATIONS : return eAnnotations != null && !eAnnotations.isEmpty(); case UMLPackage.RELATIONSHIP__OWNED_COMMENT : return ownedComments != null && !ownedComments.isEmpty(); case UMLPackage.RELATIONSHIP__OWNED_ELEMENT : return isSetOwnedElements(); case UMLPackage.RELATIONSHIP__OWNER : return isSetOwner(); case UMLPackage.RELATIONSHIP__RELATED_ELEMENT : return isSetRelatedElements(); } return eDynamicIsSet(featureID); } /** * * * @generated */ public boolean isSetRelatedElements() { return false; } } //RelationshipImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy