blob: 7886ca8bd3f53e3c7eadbec8a069076ac7c46960 [file] [log] [blame]
/**
* <copyright>
* Copyright (c) 2009, 2010 Open Canarias, S.L.
* 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
*
* </copyright>
*/
package org.eclipse.modisco.omg.gastm.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.modisco.omg.gastm.ConstructedType;
import org.eclipse.modisco.omg.gastm.GASTMPackage;
import org.eclipse.modisco.omg.gastm.TypeReference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Constructed Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.modisco.omg.gastm.impl.ConstructedTypeImpl#getBaseType <em>Base Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class ConstructedTypeImpl extends DataTypeImpl implements ConstructedType {
/**
* The cached value of the '{@link #getBaseType() <em>Base Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBaseType()
* @generated
* @ordered
*/
protected TypeReference baseType;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConstructedTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return GASTMPackage.eINSTANCE.getConstructedType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TypeReference getBaseType() {
return baseType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBaseType(TypeReference newBaseType, NotificationChain msgs) {
TypeReference oldBaseType = baseType;
baseType = newBaseType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE, oldBaseType, newBaseType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBaseType(TypeReference newBaseType) {
if (newBaseType != baseType) {
NotificationChain msgs = null;
if (baseType != null)
msgs = ((InternalEObject)baseType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE, null, msgs);
if (newBaseType != null)
msgs = ((InternalEObject)newBaseType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE, null, msgs);
msgs = basicSetBaseType(newBaseType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE, newBaseType, newBaseType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE:
return basicSetBaseType(null, 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 GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE:
return getBaseType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE:
setBaseType((TypeReference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE:
setBaseType((TypeReference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case GASTMPackage.CONSTRUCTED_TYPE__BASE_TYPE:
return baseType != null;
}
return super.eIsSet(featureID);
}
} //ConstructedTypeImpl