/******************************************************************************* * Copyright (c) 2010 Herman Lee. * 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: * Herman Lee - initial API and implementation ******************************************************************************/ package ca.uwaterloo.gsd.fsml.implModel.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 ca.uwaterloo.gsd.fsml.implModel.ImplModelPackage; import ca.uwaterloo.gsd.fsml.implModel.default_implementsInterface; import ca.uwaterloo.gsd.fsml.implModel.variant_implementsInterface; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>default implements Interface</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link ca.uwaterloo.gsd.fsml.implModel.impl.default_implementsInterfaceImpl#getVariant <em>Variant</em>}</li> * </ul> * </p> * * @generated */ public class default_implementsInterfaceImpl extends DefaultImpl implements default_implementsInterface { /** * The cached value of the '{@link #getVariant() <em>Variant</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getVariant() * @generated * @ordered */ protected EList<variant_implementsInterface> variant; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected default_implementsInterfaceImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ImplModelPackage.Literals.DEFAULT_IMPLEMENTS_INTERFACE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<variant_implementsInterface> getVariant() { if (variant == null) { variant = new EObjectContainmentEList<variant_implementsInterface>(variant_implementsInterface.class, this, ImplModelPackage.DEFAULT_IMPLEMENTS_INTERFACE__VARIANT); } return variant; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ImplModelPackage.DEFAULT_IMPLEMENTS_INTERFACE__VARIANT: return ((InternalEList<?>)getVariant()).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 ImplModelPackage.DEFAULT_IMPLEMENTS_INTERFACE__VARIANT: return getVariant(); } 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 ImplModelPackage.DEFAULT_IMPLEMENTS_INTERFACE__VARIANT: getVariant().clear(); getVariant().addAll((Collection<? extends variant_implementsInterface>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ImplModelPackage.DEFAULT_IMPLEMENTS_INTERFACE__VARIANT: getVariant().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ImplModelPackage.DEFAULT_IMPLEMENTS_INTERFACE__VARIANT: return variant != null && !variant.isEmpty(); } return super.eIsSet(featureID); } } //default_implementsInterfaceImpl