| /** |
| * ******************************************************************************* |
| * Copyright (c) 2015-2021 Robert Bosch GmbH and others. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Generated using Eclipse EMF |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.model.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.app4mc.amalthea.model.AmaltheaPackage; |
| import org.eclipse.app4mc.amalthea.model.Memory; |
| import org.eclipse.app4mc.amalthea.model.PhysicalSectionConstraint; |
| import org.eclipse.app4mc.amalthea.model.Section; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| 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.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Physical Section Constraint</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.PhysicalSectionConstraintImpl#getSection <em>Section</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.PhysicalSectionConstraintImpl#getMemories <em>Memories</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PhysicalSectionConstraintImpl extends ReferableBaseObjectImpl implements PhysicalSectionConstraint { |
| /** |
| * The cached value of the '{@link #getSection() <em>Section</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSection() |
| * @generated |
| * @ordered |
| */ |
| protected Section section; |
| |
| /** |
| * The cached value of the '{@link #getMemories() <em>Memories</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMemories() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Memory> memories; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PhysicalSectionConstraintImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getPhysicalSectionConstraint(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Section getSection() { |
| if (section != null && section.eIsProxy()) { |
| InternalEObject oldSection = (InternalEObject)section; |
| section = (Section)eResolveProxy(oldSection); |
| if (section != oldSection) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__SECTION, oldSection, section)); |
| } |
| } |
| return section; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Section basicGetSection() { |
| return section; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setSection(Section newSection) { |
| Section oldSection = section; |
| section = newSection; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__SECTION, oldSection, section)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<Memory> getMemories() { |
| if (memories == null) { |
| memories = new EObjectResolvingEList<Memory>(Memory.class, this, AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__MEMORIES); |
| } |
| return memories; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__SECTION: |
| if (resolve) return getSection(); |
| return basicGetSection(); |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__MEMORIES: |
| return getMemories(); |
| } |
| 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 AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__SECTION: |
| setSection((Section)newValue); |
| return; |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__MEMORIES: |
| getMemories().clear(); |
| getMemories().addAll((Collection<? extends Memory>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__SECTION: |
| setSection((Section)null); |
| return; |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__MEMORIES: |
| getMemories().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__SECTION: |
| return section != null; |
| case AmaltheaPackage.PHYSICAL_SECTION_CONSTRAINT__MEMORIES: |
| return memories != null && !memories.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //PhysicalSectionConstraintImpl |