blob: 5a39830e4ce31f42c9a415f58649a5aa0f1a0837 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 Willink Transformations 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:
* E.D.Willink - initial API and implementation
*******************************************************************************/
/**
*/
package classescs.impl;
import classescs.ClassCS;
import classescs.ClassescsPackage;
import classescs.PathNameCS;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Class CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link classescs.impl.ClassCSImpl#getExtends <em>Extends</em>}</li>
* </ul>
*
* @generated
*/
public class ClassCSImpl extends NamedElementCSImpl implements ClassCS {
/**
* The cached value of the '{@link #getExtends() <em>Extends</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExtends()
* @generated
* @ordered
*/
protected PathNameCS extends_;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ClassCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ClassescsPackage.Literals.CLASS_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PathNameCS getExtends() {
return extends_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExtends(PathNameCS newExtends, NotificationChain msgs) {
PathNameCS oldExtends = extends_;
extends_ = newExtends;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ClassescsPackage.CLASS_CS__EXTENDS, oldExtends, newExtends);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExtends(PathNameCS newExtends) {
if (newExtends != extends_) {
NotificationChain msgs = null;
if (extends_ != null)
msgs = ((InternalEObject)extends_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ClassescsPackage.CLASS_CS__EXTENDS, null, msgs);
if (newExtends != null)
msgs = ((InternalEObject)newExtends).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ClassescsPackage.CLASS_CS__EXTENDS, null, msgs);
msgs = basicSetExtends(newExtends, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ClassescsPackage.CLASS_CS__EXTENDS, newExtends, newExtends));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ClassescsPackage.CLASS_CS__EXTENDS:
return basicSetExtends(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 ClassescsPackage.CLASS_CS__EXTENDS:
return getExtends();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ClassescsPackage.CLASS_CS__EXTENDS:
setExtends((PathNameCS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ClassescsPackage.CLASS_CS__EXTENDS:
setExtends((PathNameCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ClassescsPackage.CLASS_CS__EXTENDS:
return extends_ != null;
}
return super.eIsSet(featureID);
}
} //ClassCSImpl