| /******************************************************************************* |
| * Copyright 2011 Chair for Applied Software Engineering, |
| * Technische Universitaet Muenchen. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| ******************************************************************************/ |
| package org.eclipse.emf.emfstore.client.model.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.EObjectImpl; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.emf.emfstore.client.model.ModelPackage; |
| import org.eclipse.emf.emfstore.client.model.OperationComposite; |
| import org.eclipse.emf.emfstore.server.model.versioning.operations.AbstractOperation; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>Operation Composite</b></em>'. <!-- |
| * end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.emf.emfstore.client.model.impl.OperationCompositeImpl#getOperations <em>Operations</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class OperationCompositeImpl extends EObjectImpl implements OperationComposite { |
| /** |
| * The cached value of the '{@link #getOperations() <em>Operations</em>}' containment reference list. <!-- |
| * begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getOperations() |
| * @generated |
| * @ordered |
| */ |
| protected EList<AbstractOperation> operations; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected OperationCompositeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ModelPackage.Literals.OPERATION_COMPOSITE; |
| } |
| |
| // begin of custom code |
| /** |
| * <!-- begin-user-doc --> |
| * Return a list of operations. Will not enforce uniqueness, do NOT add the same element twice! |
| * |
| * @return list of operations. |
| * <!-- end-user-doc --> |
| * |
| * @generated NOT |
| */ |
| @SuppressWarnings("serial") |
| public EList<AbstractOperation> getOperations() { |
| if (operations == null) { |
| operations = new EObjectContainmentEList.Resolving<AbstractOperation>(AbstractOperation.class, this, |
| ModelPackage.OPERATION_COMPOSITE__OPERATIONS) { |
| @Override |
| protected boolean isUnique() { |
| return false; |
| } |
| }; |
| |
| } |
| return operations; |
| } |
| |
| // end of custom code |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ModelPackage.OPERATION_COMPOSITE__OPERATIONS: |
| return ((InternalEList<?>) getOperations()).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 ModelPackage.OPERATION_COMPOSITE__OPERATIONS: |
| return getOperations(); |
| } |
| 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 ModelPackage.OPERATION_COMPOSITE__OPERATIONS: |
| getOperations().clear(); |
| getOperations().addAll((Collection<? extends AbstractOperation>) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ModelPackage.OPERATION_COMPOSITE__OPERATIONS: |
| getOperations().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ModelPackage.OPERATION_COMPOSITE__OPERATIONS: |
| return operations != null && !operations.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // OperationCompositeImpl |