/** | |
* <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 v2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.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.SPECIFICATION; | |
import org.eclipse.sphinx.tests.emf.serialization.env.emf.myreqif.SPECIFICATIONSType; | |
/** | |
* <!-- begin-user-doc --> An implementation of the model object '<em><b>SPECIFICATIONS 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.SPECIFICATIONSTypeImpl#getGroup <em>Group</em>}</li> | |
* <li>{@link org.eclipse.sphinx.tests.emf.serialization.env.emf.myreqif.impl.SPECIFICATIONSTypeImpl#getSPECIFICATION <em> | |
* SPECIFICATION</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class SPECIFICATIONSTypeImpl extends EObjectImpl implements SPECIFICATIONSType { | |
/** | |
* 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 SPECIFICATIONSTypeImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return MyreqifPackage.Literals.SPECIFICATIONS_TYPE; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public FeatureMap getGroup() { | |
if (group == null) { | |
group = new BasicFeatureMap(this, MyreqifPackage.SPECIFICATIONS_TYPE__GROUP); | |
} | |
return group; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EList<SPECIFICATION> getSPECIFICATION() { | |
return getGroup().list(MyreqifPackage.Literals.SPECIFICATIONS_TYPE__SPECIFICATION); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case MyreqifPackage.SPECIFICATIONS_TYPE__GROUP: | |
return ((InternalEList<?>) getGroup()).basicRemove(otherEnd, msgs); | |
case MyreqifPackage.SPECIFICATIONS_TYPE__SPECIFICATION: | |
return ((InternalEList<?>) getSPECIFICATION()).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.SPECIFICATIONS_TYPE__GROUP: | |
if (coreType) { | |
return getGroup(); | |
} | |
return ((FeatureMap.Internal) getGroup()).getWrapper(); | |
case MyreqifPackage.SPECIFICATIONS_TYPE__SPECIFICATION: | |
return getSPECIFICATION(); | |
} | |
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.SPECIFICATIONS_TYPE__GROUP: | |
((FeatureMap.Internal) getGroup()).set(newValue); | |
return; | |
case MyreqifPackage.SPECIFICATIONS_TYPE__SPECIFICATION: | |
getSPECIFICATION().clear(); | |
getSPECIFICATION().addAll((Collection<? extends SPECIFICATION>) newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case MyreqifPackage.SPECIFICATIONS_TYPE__GROUP: | |
getGroup().clear(); | |
return; | |
case MyreqifPackage.SPECIFICATIONS_TYPE__SPECIFICATION: | |
getSPECIFICATION().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case MyreqifPackage.SPECIFICATIONS_TYPE__GROUP: | |
return group != null && !group.isEmpty(); | |
case MyreqifPackage.SPECIFICATIONS_TYPE__SPECIFICATION: | |
return !getSPECIFICATION().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(); | |
} | |
} // SPECIFICATIONSTypeImpl |