| /** |
| * |
| * Copyright (c) 2009-2010 Thales Corporate Services S.A.S. |
| * 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 |
| * https://www.eclipse.org/legal/epl-v2.0.
|
| *
|
| * SPDX-License-Identifier: EPL-2.0
|
| * |
| * Contributors: |
| * Thales Corporate Services S.A.S - initial API and implementation |
| * |
| */ |
| package org.eclipse.egf.model.domain.impl; |
| |
| import org.eclipse.egf.model.domain.Domain; |
| import org.eclipse.egf.model.domain.DomainPackage; |
| import org.eclipse.egf.model.domain.TypeDomain; |
| import org.eclipse.egf.model.types.impl.TypeObjectImpl; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Type Domain</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.egf.model.domain.impl.TypeDomainImpl#getDomain <em>Domain</em>}</li> |
| * <li>{@link org.eclipse.egf.model.domain.impl.TypeDomainImpl#getValue <em>Value</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class TypeDomainImpl extends TypeObjectImpl implements TypeDomain { |
| |
| /** |
| * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| protected int flags = 0; |
| |
| /** |
| * The cached value of the '{@link #getDomain() <em>Domain</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDomain() |
| * @generated |
| * @ordered |
| */ |
| protected Domain domain; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected Domain value; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected TypeDomainImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DomainPackage.Literals.TYPE_DOMAIN; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Domain getDomain() { |
| if (domain != null && domain.eIsProxy()) { |
| InternalEObject oldDomain = (InternalEObject) domain; |
| domain = (Domain) eResolveProxy(oldDomain); |
| if (domain != oldDomain) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DomainPackage.TYPE_DOMAIN__DOMAIN, oldDomain, domain)); |
| } |
| } |
| return domain; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Domain basicGetDomain() { |
| return domain; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDomain(Domain newDomain) { |
| Domain oldDomain = domain; |
| domain = newDomain; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DomainPackage.TYPE_DOMAIN__DOMAIN, oldDomain, domain)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated NOT |
| */ |
| @Override |
| public Domain getValue() { |
| return getDomain(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Domain basicGetValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValue(Domain newValue) { |
| Domain oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DomainPackage.TYPE_DOMAIN__VALUE, oldValue, value)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DomainPackage.TYPE_DOMAIN__DOMAIN: |
| if (resolve) |
| return getDomain(); |
| return basicGetDomain(); |
| case DomainPackage.TYPE_DOMAIN__VALUE: |
| if (resolve) |
| return getValue(); |
| return basicGetValue(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DomainPackage.TYPE_DOMAIN__DOMAIN: |
| setDomain((Domain) newValue); |
| return; |
| case DomainPackage.TYPE_DOMAIN__VALUE: |
| setValue((Domain) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DomainPackage.TYPE_DOMAIN__DOMAIN: |
| setDomain((Domain) null); |
| return; |
| case DomainPackage.TYPE_DOMAIN__VALUE: |
| setValue((Domain) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DomainPackage.TYPE_DOMAIN__DOMAIN: |
| return domain != null; |
| case DomainPackage.TYPE_DOMAIN__VALUE: |
| return value != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // TypeDomainImpl |