| /* |
| * Copyright (c) 2013, 2015 Eike Stepper (Berlin, Germany) 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: |
| * Eike Stepper - initial API and implementation |
| */ |
| package org.eclipse.emf.cdo.tests.model3.subpackage.legacy.impl; |
| |
| import org.eclipse.emf.cdo.tests.model3.Class1; |
| import org.eclipse.emf.cdo.tests.model3.legacy.Model3Package; |
| import org.eclipse.emf.cdo.tests.model3.subpackage.Class2; |
| import org.eclipse.emf.cdo.tests.model3.subpackage.legacy.SubpackagePackage; |
| |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import java.util.Collection; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>Class2</b></em>'. <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.emf.cdo.tests.model3.subpackage.legacy.impl.Class2Impl#getClass1 <em>Class1</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class Class2Impl extends EObjectImpl implements Class2 |
| { |
| /** |
| * The cached value of the '{@link #getClass1() <em>Class1</em>}' reference list. |
| * <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * @see #getClass1() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Class1> class1; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| protected Class2Impl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return SubpackagePackage.Literals.CLASS2; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Class1> getClass1() |
| { |
| if (class1 == null) |
| { |
| class1 = new EObjectWithInverseResolvingEList.ManyInverse<Class1>(Class1.class, this, |
| SubpackagePackage.CLASS2__CLASS1, Model3Package.CLASS1__CLASS2); |
| } |
| return class1; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case SubpackagePackage.CLASS2__CLASS1: |
| return ((InternalEList<InternalEObject>)(InternalEList<?>)getClass1()).basicAdd(otherEnd, msgs); |
| } |
| return super.eInverseAdd(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case SubpackagePackage.CLASS2__CLASS1: |
| return ((InternalEList<?>)getClass1()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case SubpackagePackage.CLASS2__CLASS1: |
| return getClass1(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case SubpackagePackage.CLASS2__CLASS1: |
| getClass1().clear(); |
| getClass1().addAll((Collection<? extends Class1>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case SubpackagePackage.CLASS2__CLASS1: |
| getClass1().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case SubpackagePackage.CLASS2__CLASS1: |
| return class1 != null && !class1.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // Class2Impl |