diff options
Diffstat (limited to 'extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/environment/impl/EnvironmentImpl.java')
-rw-r--r-- | extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/environment/impl/EnvironmentImpl.java | 170 |
1 files changed, 103 insertions, 67 deletions
diff --git a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/environment/impl/EnvironmentImpl.java b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/environment/impl/EnvironmentImpl.java index 851b28c18ef..4d75dea76e7 100644 --- a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/environment/impl/EnvironmentImpl.java +++ b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/environment/impl/EnvironmentImpl.java @@ -1,7 +1,7 @@ /***************************************************************************** * Copyright (c) 2010 CEA LIST. * - * + * * 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 @@ -42,10 +42,10 @@ import org.eclipse.uml2.uml.util.UMLUtil; * <p> * The following features are implemented: * <ul> - * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getEnvironmentModel <em>Environment Model</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getClampConnector <em>Clamp Connector</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getBase_Class <em>Base Class</em>}</li> - * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getBase_Package <em>Base Package</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getEnvironmentModel <em>Environment Model</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getClampConnector <em>Clamp Connector</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getBase_Class <em>Base Class</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.environment.impl.EnvironmentImpl#getBase_Package <em>Base Package</em>}</li> * </ul> * </p> * @@ -56,6 +56,7 @@ public class EnvironmentImpl extends ContextImpl implements Environment { * The cached value of the '{@link #getBase_Class() <em>Base Class</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getBase_Class() * @generated * @ordered @@ -66,6 +67,7 @@ public class EnvironmentImpl extends ContextImpl implements Environment { * The cached value of the '{@link #getBase_Package() <em>Base Package</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getBase_Package() * @generated * @ordered @@ -75,6 +77,7 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected EnvironmentImpl() { @@ -84,43 +87,52 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated NOT */ public FunctionPrototype basicGetEnvironmentModel() { FunctionPrototype adlFunctionPrototype = null; - + if (getBase_NamedElement() != null) { Iterator<Element> it = getBase_NamedElement().getOwnedElements().iterator(); while (it.hasNext()) { Element element = it.next(); - adlFunctionPrototype = (FunctionPrototype) UMLUtil.getStereotypeApplication(element, FunctionPrototype.class); - if (adlFunctionPrototype !=null) + adlFunctionPrototype = UMLUtil.getStereotypeApplication(element, FunctionPrototype.class); + if (adlFunctionPrototype != null) { return adlFunctionPrototype; + } } } - + return adlFunctionPrototype; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: - if (resolve) return getEnvironmentModel(); - return basicGetEnvironmentModel(); - case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: - return getClampConnector(); - case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: - if (resolve) return getBase_Package(); - return basicGetBase_Package(); + case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: + if (resolve) { + return getEnvironmentModel(); + } + return basicGetEnvironmentModel(); + case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: + return getClampConnector(); + case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: + if (resolve) { + return getBase_Class(); + } + return basicGetBase_Class(); + case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: + if (resolve) { + return getBase_Package(); + } + return basicGetBase_Package(); } return super.eGet(featureID, resolve, coreType); } @@ -128,19 +140,20 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { - case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: - return basicGetEnvironmentModel() != null; - case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: - return !getClampConnector().isEmpty(); - case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: - return base_Class != null; - case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: - return base_Package != null; + case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: + return basicGetEnvironmentModel() != null; + case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: + return !getClampConnector().isEmpty(); + case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: + return base_Class != null; + case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: + return base_Package != null; } return super.eIsSet(featureID); } @@ -148,25 +161,26 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: - setEnvironmentModel((FunctionPrototype)newValue); - return; - case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: - getClampConnector().clear(); - getClampConnector().addAll((Collection<? extends ClampConnector>)newValue); - return; - case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)newValue); - return; + case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: + setEnvironmentModel((FunctionPrototype) newValue); + return; + case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: + getClampConnector().clear(); + getClampConnector().addAll((Collection<? extends ClampConnector>) newValue); + return; + case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class) newValue); + return; + case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) newValue); + return; } super.eSet(featureID, newValue); } @@ -174,6 +188,7 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -184,23 +199,24 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { - case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: - setEnvironmentModel((FunctionPrototype)null); - return; - case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: - getClampConnector().clear(); - return; - case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)null); - return; + case EnvironmentPackage.ENVIRONMENT__ENVIRONMENT_MODEL: + setEnvironmentModel((FunctionPrototype) null); + return; + case EnvironmentPackage.ENVIRONMENT__CLAMP_CONNECTOR: + getClampConnector().clear(); + return; + case EnvironmentPackage.ENVIRONMENT__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class) null); + return; + case EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) null); + return; } super.eUnset(featureID); } @@ -208,20 +224,22 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated NOT */ + @Override public EList<ClampConnector> getClampConnector() { EList<ClampConnector> results = new BasicEList<ClampConnector>(); ClampConnector clampConnector = null; - if(getBase_Class() != null) { + if (getBase_Class() != null) { Iterator<Port> it = getBase_Class().getOwnedPorts().iterator(); - while(it.hasNext()) { + while (it.hasNext()) { Port current = it.next(); - clampConnector = (ClampConnector)UMLUtil.getStereotypeApplication(current, ClampConnector.class); + clampConnector = UMLUtil.getStereotypeApplication(current, ClampConnector.class); - if(clampConnector != null) { + if (clampConnector != null) { results.add(clampConnector); } } @@ -233,15 +251,18 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ + @Override public org.eclipse.uml2.uml.Class getBase_Class() { if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + InternalEObject oldBase_Class = (InternalEObject) base_Class; + base_Class = (org.eclipse.uml2.uml.Class) eResolveProxy(oldBase_Class); if (base_Class != oldBase_Class) { - if (eNotificationRequired()) + if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.RESOLVE, EnvironmentPackage.ENVIRONMENT__BASE_CLASS, oldBase_Class, base_Class)); + } } } return base_Class; @@ -250,6 +271,7 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public org.eclipse.uml2.uml.Class basicGetBase_Class() { @@ -259,27 +281,33 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ + @Override public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { org.eclipse.uml2.uml.Class oldBase_Class = base_Class; base_Class = newBase_Class; - if (eNotificationRequired()) + if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, EnvironmentPackage.ENVIRONMENT__BASE_CLASS, oldBase_Class, base_Class)); + } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ + @Override public org.eclipse.uml2.uml.Package getBase_Package() { if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject)base_Package; - base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); + InternalEObject oldBase_Package = (InternalEObject) base_Package; + base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); if (base_Package != oldBase_Package) { - if (eNotificationRequired()) + if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.RESOLVE, EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE, oldBase_Package, base_Package)); + } } } return base_Package; @@ -288,6 +316,7 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public org.eclipse.uml2.uml.Package basicGetBase_Package() { @@ -297,34 +326,41 @@ public class EnvironmentImpl extends ContextImpl implements Environment { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ + @Override public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { org.eclipse.uml2.uml.Package oldBase_Package = base_Package; base_Package = newBase_Package; - if (eNotificationRequired()) + if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, EnvironmentPackage.ENVIRONMENT__BASE_PACKAGE, oldBase_Package, base_Package)); + } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ + @Override public FunctionPrototype getEnvironmentModel() { FunctionPrototype environmentModel = basicGetEnvironmentModel(); - return environmentModel != null && environmentModel.eIsProxy() ? (FunctionPrototype)eResolveProxy((InternalEObject)environmentModel) : environmentModel; + return environmentModel != null && environmentModel.eIsProxy() ? (FunctionPrototype) eResolveProxy((InternalEObject) environmentModel) : environmentModel; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ + @Override public void setEnvironmentModel(FunctionPrototype newEnvironmentModel) { // TODO: implement this method to set the 'Environment Model' reference // Ensure that you remove @generated or mark it @generated NOT throw new UnsupportedOperationException(); } -} //EnvironmentImpl +} // EnvironmentImpl |