blob: 3c8c20a06361a4dfe0ab1131ea3f2643056c91cc [file] [log] [blame]
/**
* 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:
* Mark Broerkens - initial API and implementation
*
*/
package org.eclipse.rmf.reqif10.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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.rmf.reqif10.AttributeDefinition;
import org.eclipse.rmf.reqif10.ReqIF10Package;
import org.eclipse.rmf.reqif10.SpecType;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Spec Type</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rmf.reqif10.impl.SpecTypeImpl#getSpecAttributes <em>Spec Attributes</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class SpecTypeImpl extends IdentifiableImpl implements SpecType {
/**
* The cached value of the '{@link #getSpecAttributes() <em>Spec Attributes</em>}' containment reference list. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getSpecAttributes()
* @generated
* @ordered
*/
protected EList<AttributeDefinition> specAttributes;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected SpecTypeImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReqIF10Package.Literals.SPEC_TYPE;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EList<AttributeDefinition> getSpecAttributes() {
if (specAttributes == null) {
specAttributes = new EObjectContainmentEList.Unsettable<AttributeDefinition>(AttributeDefinition.class, this,
ReqIF10Package.SPEC_TYPE__SPEC_ATTRIBUTES);
}
return specAttributes;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void unsetSpecAttributes() {
if (specAttributes != null)
((InternalEList.Unsettable<?>) specAttributes).unset();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public boolean isSetSpecAttributes() {
return specAttributes != null && ((InternalEList.Unsettable<?>) specAttributes).isSet();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ReqIF10Package.SPEC_TYPE__SPEC_ATTRIBUTES:
return ((InternalEList<?>) getSpecAttributes()).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 ReqIF10Package.SPEC_TYPE__SPEC_ATTRIBUTES:
return getSpecAttributes();
}
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 ReqIF10Package.SPEC_TYPE__SPEC_ATTRIBUTES:
getSpecAttributes().clear();
getSpecAttributes().addAll((Collection<? extends AttributeDefinition>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReqIF10Package.SPEC_TYPE__SPEC_ATTRIBUTES:
unsetSpecAttributes();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReqIF10Package.SPEC_TYPE__SPEC_ATTRIBUTES:
return isSetSpecAttributes();
}
return super.eIsSet(featureID);
}
} // SpecTypeImpl