| /** |
| * 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.AttributeValue; |
| import org.eclipse.rmf.reqif10.ReqIF10Package; |
| import org.eclipse.rmf.reqif10.SpecElementWithAttributes; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>Spec Element With Attributes</b></em>'. <!-- |
| * end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rmf.reqif10.impl.SpecElementWithAttributesImpl#getValues <em>Values</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public abstract class SpecElementWithAttributesImpl extends IdentifiableImpl implements SpecElementWithAttributes { |
| /** |
| * The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list. <!-- begin-user-doc |
| * --> <!-- end-user-doc --> |
| * |
| * @see #getValues() |
| * @generated |
| * @ordered |
| */ |
| protected EList<AttributeValue> values; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected SpecElementWithAttributesImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReqIF10Package.Literals.SPEC_ELEMENT_WITH_ATTRIBUTES; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EList<AttributeValue> getValues() { |
| if (values == null) { |
| values = new EObjectContainmentEList.Unsettable<AttributeValue>(AttributeValue.class, this, |
| ReqIF10Package.SPEC_ELEMENT_WITH_ATTRIBUTES__VALUES); |
| } |
| return values; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void unsetValues() { |
| if (values != null) |
| ((InternalEList.Unsettable<?>) values).unset(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public boolean isSetValues() { |
| return values != null && ((InternalEList.Unsettable<?>) values).isSet(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ReqIF10Package.SPEC_ELEMENT_WITH_ATTRIBUTES__VALUES: |
| return ((InternalEList<?>) getValues()).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_ELEMENT_WITH_ATTRIBUTES__VALUES: |
| return getValues(); |
| } |
| 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_ELEMENT_WITH_ATTRIBUTES__VALUES: |
| getValues().clear(); |
| getValues().addAll((Collection<? extends AttributeValue>) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ReqIF10Package.SPEC_ELEMENT_WITH_ATTRIBUTES__VALUES: |
| unsetValues(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReqIF10Package.SPEC_ELEMENT_WITH_ATTRIBUTES__VALUES: |
| return isSetValues(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // SpecElementWithAttributesImpl |