/******************************************************************************* * Copyright (c) 2014 Hussein Mhanna * * 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: * Hussein Mhanna - initial API and implementation ******************************************************************************/ package org.eclipse.rmf.reqif10.csv.importer.mapping.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.rmf.reqif10.csv.importer.mapping.MappingItem; import org.eclipse.rmf.reqif10.csv.importer.mapping.MappingLibrary; import org.eclipse.rmf.reqif10.csv.importer.mapping.MappingPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Library</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.rmf.reqif10.csv.importer.mapping.impl.MappingLibraryImpl#getItems <em>Items</em>}</li> * </ul> * </p> * * @generated */ public class MappingLibraryImpl extends MinimalEObjectImpl.Container implements MappingLibrary { /** * The cached value of the '{@link #getItems() <em>Items</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getItems() * @generated * @ordered */ protected EList<MappingItem> items; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MappingLibraryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return MappingPackage.Literals.MAPPING_LIBRARY; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<MappingItem> getItems() { if (items == null) { items = new EObjectContainmentEList<MappingItem>(MappingItem.class, this, MappingPackage.MAPPING_LIBRARY__ITEMS); } return items; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case MappingPackage.MAPPING_LIBRARY__ITEMS: return ((InternalEList<?>)getItems()).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 MappingPackage.MAPPING_LIBRARY__ITEMS: return getItems(); } 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 MappingPackage.MAPPING_LIBRARY__ITEMS: getItems().clear(); getItems().addAll((Collection<? extends MappingItem>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case MappingPackage.MAPPING_LIBRARY__ITEMS: getItems().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case MappingPackage.MAPPING_LIBRARY__ITEMS: return items != null && !items.isEmpty(); } return super.eIsSet(featureID); } } //MappingLibraryImpl