/** | |
* <copyright> | |
* | |
* Copyright (c) 2014 itemis 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 - Initial API and implementation | |
* | |
* </copyright> | |
*/ | |
package org.eclipse.sphinx.tests.emf.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.sphinx.tests.emf.serialization.env.emf.myreqif.MyreqifPackage; | |
import org.eclipse.sphinx.tests.emf.serialization.env.emf.myreqif.RELATIONGROUP; | |
import org.eclipse.sphinx.tests.emf.serialization.env.emf.myreqif.SPECRELATIONGROUPSType; | |
/** | |
* <!-- begin-user-doc --> An implementation of the model object '<em><b>SPECRELATIONGROUPS Type</b></em>'. <!-- | |
* end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.sphinx.tests.emf.serialization.env.emf.myreqif.impl.SPECRELATIONGROUPSTypeImpl#getGroup <em>Group | |
* </em>}</li> | |
* <li>{@link org.eclipse.sphinx.tests.emf.serialization.env.emf.myreqif.impl.SPECRELATIONGROUPSTypeImpl#getRELATIONGROUP <em> | |
* RELATIONGROUP</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class SPECRELATIONGROUPSTypeImpl extends EObjectImpl implements SPECRELATIONGROUPSType { | |
/** | |
* 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 SPECRELATIONGROUPSTypeImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return MyreqifPackage.Literals.SPECRELATIONGROUPS_TYPE; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public FeatureMap getGroup() { | |
if (group == null) { | |
group = new BasicFeatureMap(this, MyreqifPackage.SPECRELATIONGROUPS_TYPE__GROUP); | |
} | |
return group; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EList<RELATIONGROUP> getRELATIONGROUP() { | |
return getGroup().list(MyreqifPackage.Literals.SPECRELATIONGROUPS_TYPE__RELATIONGROUP); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__GROUP: | |
return ((InternalEList<?>) getGroup()).basicRemove(otherEnd, msgs); | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__RELATIONGROUP: | |
return ((InternalEList<?>) getRELATIONGROUP()).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.SPECRELATIONGROUPS_TYPE__GROUP: | |
if (coreType) { | |
return getGroup(); | |
} | |
return ((FeatureMap.Internal) getGroup()).getWrapper(); | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__RELATIONGROUP: | |
return getRELATIONGROUP(); | |
} | |
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.SPECRELATIONGROUPS_TYPE__GROUP: | |
((FeatureMap.Internal) getGroup()).set(newValue); | |
return; | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__RELATIONGROUP: | |
getRELATIONGROUP().clear(); | |
getRELATIONGROUP().addAll((Collection<? extends RELATIONGROUP>) newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__GROUP: | |
getGroup().clear(); | |
return; | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__RELATIONGROUP: | |
getRELATIONGROUP().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__GROUP: | |
return group != null && !group.isEmpty(); | |
case MyreqifPackage.SPECRELATIONGROUPS_TYPE__RELATIONGROUP: | |
return !getRELATIONGROUP().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(); | |
} | |
} // SPECRELATIONGROUPSTypeImpl |