| /** |
| * Copyright (c) 2014 Fraunhofer FOKUS |
| * 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: |
| * Marc-Florian Wendland |
| */ |
| package org.eclipse.upr.utp.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EcoreUtil; |
| |
| import org.eclipse.uml2.common.util.CacheAdapter; |
| |
| import org.eclipse.uml2.uml.Dependency; |
| |
| import org.eclipse.upr.utp.DefaultApplication; |
| import org.eclipse.upr.utp.UTPPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Default Application</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.upr.utp.impl.DefaultApplicationImpl#getRepetition <em>Repetition</em>}</li> |
| * <li>{@link org.eclipse.upr.utp.impl.DefaultApplicationImpl#getBase_Dependency <em>Base Dependency</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class DefaultApplicationImpl extends EObjectImpl implements DefaultApplication { |
| /** |
| * The default value of the '{@link #getRepetition() <em>Repetition</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRepetition() |
| * @generated |
| * @ordered |
| */ |
| protected static final int REPETITION_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getRepetition() <em>Repetition</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRepetition() |
| * @generated |
| * @ordered |
| */ |
| protected int repetition = REPETITION_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getBase_Dependency() <em>Base Dependency</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Dependency() |
| * @generated |
| * @ordered |
| */ |
| protected Dependency base_Dependency; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DefaultApplicationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UTPPackage.Literals.DEFAULT_APPLICATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getRepetition() { |
| return repetition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRepetition(int newRepetition) { |
| int oldRepetition = repetition; |
| repetition = newRepetition; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UTPPackage.DEFAULT_APPLICATION__REPETITION, oldRepetition, repetition)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Dependency getBase_Dependency() { |
| if (base_Dependency != null && base_Dependency.eIsProxy()) { |
| InternalEObject oldBase_Dependency = (InternalEObject)base_Dependency; |
| base_Dependency = (Dependency)eResolveProxy(oldBase_Dependency); |
| if (base_Dependency != oldBase_Dependency) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, UTPPackage.DEFAULT_APPLICATION__BASE_DEPENDENCY, oldBase_Dependency, base_Dependency)); |
| } |
| } |
| return base_Dependency; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Dependency basicGetBase_Dependency() { |
| return base_Dependency; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_Dependency(Dependency newBase_Dependency) { |
| Dependency oldBase_Dependency = base_Dependency; |
| base_Dependency = newBase_Dependency; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UTPPackage.DEFAULT_APPLICATION__BASE_DEPENDENCY, oldBase_Dependency, base_Dependency)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UTPPackage.DEFAULT_APPLICATION__REPETITION: |
| return getRepetition(); |
| case UTPPackage.DEFAULT_APPLICATION__BASE_DEPENDENCY: |
| if (resolve) return getBase_Dependency(); |
| return basicGetBase_Dependency(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case UTPPackage.DEFAULT_APPLICATION__REPETITION: |
| setRepetition((Integer)newValue); |
| return; |
| case UTPPackage.DEFAULT_APPLICATION__BASE_DEPENDENCY: |
| setBase_Dependency((Dependency)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UTPPackage.DEFAULT_APPLICATION__REPETITION: |
| setRepetition(REPETITION_EDEFAULT); |
| return; |
| case UTPPackage.DEFAULT_APPLICATION__BASE_DEPENDENCY: |
| setBase_Dependency((Dependency)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UTPPackage.DEFAULT_APPLICATION__REPETITION: |
| return repetition != REPETITION_EDEFAULT; |
| case UTPPackage.DEFAULT_APPLICATION__BASE_DEPENDENCY: |
| return base_Dependency != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (repetition: "); |
| result.append(repetition); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| /** |
| * Creates a new instance of the specified Ecore class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param eClass The Ecore class of the instance to create. |
| * @return The new instance. |
| * @generated |
| */ |
| protected EObject create(EClass eClass) { |
| return EcoreUtil.create(eClass); |
| } |
| |
| /** |
| * Retrieves the cache adapter for this '<em><b>Default Application</b></em>'. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @return The cache adapter for this '<em><b>Default Application</b></em>'. |
| * @generated |
| */ |
| protected CacheAdapter getCacheAdapter() { |
| return CacheAdapter.getCacheAdapter(this); |
| } |
| |
| } //DefaultApplicationImpl |