| /** |
| * Copyright (c) 2016 Willink Transformations, Univesity of York and others. |
| * 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: |
| * Adolfo Sanchez-Barbudo Herrera - initial API and implementation |
| */ |
| package delphi.impl; |
| |
| import delphi.DelphiPackage; |
| import delphi.varDecl; |
| import delphi.varSection; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>var Section</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link delphi.impl.varSectionImpl#getVarDecls <em>Var Decls</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class varSectionImpl extends interfaceDeclImpl implements varSection { |
| /** |
| * The cached value of the '{@link #getVarDecls() <em>Var Decls</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVarDecls() |
| * @generated |
| * @ordered |
| */ |
| protected EList<varDecl> varDecls; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected varSectionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DelphiPackage.Literals.VAR_SECTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<varDecl> getVarDecls() { |
| if (varDecls == null) { |
| varDecls = new EObjectContainmentEList<varDecl>(varDecl.class, this, DelphiPackage.VAR_SECTION__VAR_DECLS); |
| } |
| return varDecls; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DelphiPackage.VAR_SECTION__VAR_DECLS: |
| return ((InternalEList<?>)getVarDecls()).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 DelphiPackage.VAR_SECTION__VAR_DECLS: |
| return getVarDecls(); |
| } |
| 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 DelphiPackage.VAR_SECTION__VAR_DECLS: |
| getVarDecls().clear(); |
| getVarDecls().addAll((Collection<? extends varDecl>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DelphiPackage.VAR_SECTION__VAR_DECLS: |
| getVarDecls().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DelphiPackage.VAR_SECTION__VAR_DECLS: |
| return varDecls != null && !varDecls.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| |
| } //varSectionImpl |