/** * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. 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 </copyright> */ package org.eclipse.emf.emfstore.client.test.model.requirement.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.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.emf.emfstore.client.test.model.impl.UnicaseModelElementImpl; import org.eclipse.emf.emfstore.client.test.model.requirement.RequirementPackage; import org.eclipse.emf.emfstore.client.test.model.requirement.SystemFunction; import org.eclipse.emf.emfstore.client.test.model.requirement.Workspace; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>Workspace</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.emfstore.client.test.model.requirement.impl.WorkspaceImpl#getSystemFunctions <em>System * Functions</em>}</li> * </ul> * </p> * * @generated */ public class WorkspaceImpl extends UnicaseModelElementImpl implements Workspace { /** * The cached value of the '{@link #getSystemFunctions() <em>System Functions</em>}' reference list. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @see #getSystemFunctions() * @generated * @ordered */ protected EList<SystemFunction> systemFunctions; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected WorkspaceImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return RequirementPackage.Literals.WORKSPACE; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public EList<SystemFunction> getSystemFunctions() { if (systemFunctions == null) { systemFunctions = new EObjectWithInverseResolvingEList<SystemFunction>(SystemFunction.class, this, RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS, RequirementPackage.SYSTEM_FUNCTION__WORKSPACE); } return systemFunctions; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS: return ((InternalEList<InternalEObject>) (InternalEList<?>) getSystemFunctions()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS: return ((InternalEList<?>) getSystemFunctions()).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 RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS: return getSystemFunctions(); } 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 RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS: getSystemFunctions().clear(); getSystemFunctions().addAll((Collection<? extends SystemFunction>) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS: getSystemFunctions().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case RequirementPackage.WORKSPACE__SYSTEM_FUNCTIONS: return systemFunctions != null && !systemFunctions.isEmpty(); } return super.eIsSet(featureID); } } // WorkspaceImpl