blob: 56611e2abaa22a4fd9b38a9b777468437696fe83 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id: DictionaryTypeImpl.java,v 1.2 2009/01/25 23:11:18 radvorak Exp $
*/
package org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.impl;
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;
import org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.DictionaryType;
import org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.ImperativeOCLPackage;
import org.eclipse.qvt.declarative.emof.EMOF.Type;
import org.eclipse.qvt.declarative.emof.EssentialOCL.impl.CollectionTypeImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Dictionary Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.impl.DictionaryTypeImpl#getKeyType <em>Key Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DictionaryTypeImpl extends CollectionTypeImpl implements DictionaryType {
/**
* The cached value of the '{@link #getKeyType() <em>Key Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKeyType()
* @generated
* @ordered
*/
protected Type keyType;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DictionaryTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ImperativeOCLPackage.Literals.DICTIONARY_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Type getKeyType() {
if (keyType != null && keyType.eIsProxy()) {
InternalEObject oldKeyType = (InternalEObject)keyType;
keyType = (Type)eResolveProxy(oldKeyType);
if (keyType != oldKeyType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ImperativeOCLPackage.DICTIONARY_TYPE__KEY_TYPE, oldKeyType, keyType));
}
}
return keyType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Type basicGetKeyType() {
return keyType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setKeyType(Type newKeyType) {
Type oldKeyType = keyType;
keyType = newKeyType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ImperativeOCLPackage.DICTIONARY_TYPE__KEY_TYPE, oldKeyType, keyType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ImperativeOCLPackage.DICTIONARY_TYPE__KEY_TYPE:
if (resolve) return getKeyType();
return basicGetKeyType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ImperativeOCLPackage.DICTIONARY_TYPE__KEY_TYPE:
setKeyType((Type)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ImperativeOCLPackage.DICTIONARY_TYPE__KEY_TYPE:
setKeyType((Type)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ImperativeOCLPackage.DICTIONARY_TYPE__KEY_TYPE:
return keyType != null;
}
return super.eIsSet(featureID);
}
} //DictionaryTypeImpl