/** * Copyright (c) 2013 itemis AG 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: * itemis AG - initial API and implementation * */ package org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl; import java.util.Collection; 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.BasicFeatureMap; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.rmf.tests.serialization.env.emf.myreqif.MyreqifPackage; import org.eclipse.rmf.tests.serialization.env.emf.myreqif.SPECRELATION; import org.eclipse.rmf.tests.serialization.env.emf.myreqif.SPECRELATIONSType1; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>SPECRELATIONS Type1</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.SPECRELATIONSType1Impl#getGroup <em>Group</em>}</li> * <li>{@link org.eclipse.rmf.tests.serialization.env.emf.myreqif.impl.SPECRELATIONSType1Impl#getSPECRELATION <em>SPECRELATION</em>}</li> * </ul> * </p> * * @generated */ public class SPECRELATIONSType1Impl extends EObjectImpl implements SPECRELATIONSType1 { /** * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getGroup() * @generated * @ordered */ protected FeatureMap group; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SPECRELATIONSType1Impl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return MyreqifPackage.Literals.SPECRELATIONS_TYPE1; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public FeatureMap getGroup() { if (group == null) { group = new BasicFeatureMap(this, MyreqifPackage.SPECRELATIONS_TYPE1__GROUP); } return group; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<SPECRELATION> getSPECRELATION() { return getGroup().list(MyreqifPackage.Literals.SPECRELATIONS_TYPE1__SPECRELATION); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case MyreqifPackage.SPECRELATIONS_TYPE1__GROUP: return ((InternalEList<?>)getGroup()).basicRemove(otherEnd, msgs); case MyreqifPackage.SPECRELATIONS_TYPE1__SPECRELATION: return ((InternalEList<?>)getSPECRELATION()).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 MyreqifPackage.SPECRELATIONS_TYPE1__GROUP: if (coreType) return getGroup(); return ((FeatureMap.Internal)getGroup()).getWrapper(); case MyreqifPackage.SPECRELATIONS_TYPE1__SPECRELATION: return getSPECRELATION(); } 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 MyreqifPackage.SPECRELATIONS_TYPE1__GROUP: ((FeatureMap.Internal)getGroup()).set(newValue); return; case MyreqifPackage.SPECRELATIONS_TYPE1__SPECRELATION: getSPECRELATION().clear(); getSPECRELATION().addAll((Collection<? extends SPECRELATION>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case MyreqifPackage.SPECRELATIONS_TYPE1__GROUP: getGroup().clear(); return; case MyreqifPackage.SPECRELATIONS_TYPE1__SPECRELATION: getSPECRELATION().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case MyreqifPackage.SPECRELATIONS_TYPE1__GROUP: return group != null && !group.isEmpty(); case MyreqifPackage.SPECRELATIONS_TYPE1__SPECRELATION: return !getSPECRELATION().isEmpty(); } 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(" (group: "); result.append(group); result.append(')'); return result.toString(); } } //SPECRELATIONSType1Impl