| /******************************************************************************* |
| * Copyright (c) 2016 Fundación Tecnalia Research & Innovation. |
| * |
| * 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: |
| * Huascar Espinoza - initial API and implementation |
| * Alejandra Ruíz - initial API and implementation |
| * Idoya Del Río - initial API and implementation |
| * Mari Carmen Palacios - initial API and implementation |
| * Angel López - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.opencert.sam.agree.agreement.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.MinimalEObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.opencert.sam.agree.agreement.AgreementPackage; |
| import org.eclipse.opencert.sam.agree.agreement.assertionDefinition; |
| import org.eclipse.opencert.sam.agree.agreement.assertionpattern; |
| import org.eclipse.opencert.sam.agree.agreement.viewpointId; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>assertion Definition</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.opencert.sam.agree.agreement.impl.assertionDefinitionImpl#getAssertion <em>Assertion</em>}</li> |
| * <li>{@link org.eclipse.opencert.sam.agree.agreement.impl.assertionDefinitionImpl#getP <em>P</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class assertionDefinitionImpl extends MinimalEObjectImpl.Container implements assertionDefinition |
| { |
| /** |
| * The cached value of the '{@link #getAssertion() <em>Assertion</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAssertion() |
| * @generated |
| * @ordered |
| */ |
| protected EList<viewpointId> assertion; |
| |
| /** |
| * The cached value of the '{@link #getP() <em>P</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getP() |
| * @generated |
| * @ordered |
| */ |
| protected EList<assertionpattern> p; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected assertionDefinitionImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return AgreementPackage.Literals.ASSERTION_DEFINITION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<viewpointId> getAssertion() |
| { |
| if (assertion == null) |
| { |
| assertion = new EObjectContainmentEList<viewpointId>(viewpointId.class, this, AgreementPackage.ASSERTION_DEFINITION__ASSERTION); |
| } |
| return assertion; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<assertionpattern> getP() |
| { |
| if (p == null) |
| { |
| p = new EObjectContainmentEList<assertionpattern>(assertionpattern.class, this, AgreementPackage.ASSERTION_DEFINITION__P); |
| } |
| return p; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case AgreementPackage.ASSERTION_DEFINITION__ASSERTION: |
| return ((InternalEList<?>)getAssertion()).basicRemove(otherEnd, msgs); |
| case AgreementPackage.ASSERTION_DEFINITION__P: |
| return ((InternalEList<?>)getP()).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 AgreementPackage.ASSERTION_DEFINITION__ASSERTION: |
| return getAssertion(); |
| case AgreementPackage.ASSERTION_DEFINITION__P: |
| return getP(); |
| } |
| 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 AgreementPackage.ASSERTION_DEFINITION__ASSERTION: |
| getAssertion().clear(); |
| getAssertion().addAll((Collection<? extends viewpointId>)newValue); |
| return; |
| case AgreementPackage.ASSERTION_DEFINITION__P: |
| getP().clear(); |
| getP().addAll((Collection<? extends assertionpattern>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case AgreementPackage.ASSERTION_DEFINITION__ASSERTION: |
| getAssertion().clear(); |
| return; |
| case AgreementPackage.ASSERTION_DEFINITION__P: |
| getP().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case AgreementPackage.ASSERTION_DEFINITION__ASSERTION: |
| return assertion != null && !assertion.isEmpty(); |
| case AgreementPackage.ASSERTION_DEFINITION__P: |
| return p != null && !p.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //assertionDefinitionImpl |