| /** |
| * <copyright> |
| * Copyright (c) 2008, 2018 Open Canarias S.L. and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * A. Sanchez-Barbudo - initial API and implementation |
| * </copyright> |
| * |
| * $Id: BlockExpImpl.java,v 1.3 2009/02/06 15:47:30 radvorak Exp $ |
| */ |
| package org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.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 org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.BlockExp; |
| import org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.ImperativeOCLPackage; |
| import org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.util.ImperativeOCLVisitor; |
| import org.eclipse.ocl.ecore.OCLExpression; |
| import org.eclipse.ocl.utilities.Visitor; |
| |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Block Exp</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.BlockExpImpl#getBody <em>Body</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class BlockExpImpl extends ImperativeExpressionImpl implements BlockExp { |
| /** |
| * The cached value of the '{@link #getBody() <em>Body</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBody() |
| * @generated |
| * @ordered |
| */ |
| protected EList<OCLExpression> body; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BlockExpImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ImperativeOCLPackage.Literals.BLOCK_EXP; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<OCLExpression> getBody() { |
| if (body == null) { |
| body = new EObjectContainmentEList<OCLExpression>(OCLExpression.class, this, ImperativeOCLPackage.BLOCK_EXP__BODY); |
| } |
| return body; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ImperativeOCLPackage.BLOCK_EXP__BODY: |
| return ((InternalEList<?>)getBody()).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 ImperativeOCLPackage.BLOCK_EXP__BODY: |
| return getBody(); |
| } |
| 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 ImperativeOCLPackage.BLOCK_EXP__BODY: |
| getBody().clear(); |
| getBody().addAll((Collection<? extends OCLExpression>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ImperativeOCLPackage.BLOCK_EXP__BODY: |
| getBody().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ImperativeOCLPackage.BLOCK_EXP__BODY: |
| return body != null && !body.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * @generated NOT |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) { |
| if (v instanceof ImperativeOCLVisitor) |
| return (T) ((ImperativeOCLVisitor) v).visitBlockExp(this); |
| return super.<T, U>accept(v); |
| } |
| |
| } //BlockExpImpl |