blob: 6f9cc66d4a4d345b0a7373878504d9ff28402118 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016, 2018 Willink Transformations and others.
* All rights reserved. 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
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
/**
*/
package example4.kiamacs.impl;
import example4.kiamacs.KiamacsPackage;
import example4.kiamacs.NodeCS;
import example4.kiamacs.TopCS;
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>Top CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link example4.kiamacs.impl.TopCSImpl#getNode <em>Node</em>}</li>
* </ul>
*
* @generated
*/
public class TopCSImpl extends BaseCSImpl implements TopCS {
/**
* The cached value of the '{@link #getNode() <em>Node</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNode()
* @generated
* @ordered
*/
protected NodeCS node;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TopCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return KiamacsPackage.Literals.TOP_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NodeCS getNode() {
return node;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetNode(NodeCS newNode, NotificationChain msgs) {
NodeCS oldNode = node;
node = newNode;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, KiamacsPackage.TOP_CS__NODE, oldNode, newNode);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setNode(NodeCS newNode) {
if (newNode != node) {
NotificationChain msgs = null;
if (node != null)
msgs = ((InternalEObject)node).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - KiamacsPackage.TOP_CS__NODE, null, msgs);
if (newNode != null)
msgs = ((InternalEObject)newNode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - KiamacsPackage.TOP_CS__NODE, null, msgs);
msgs = basicSetNode(newNode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KiamacsPackage.TOP_CS__NODE, newNode, newNode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case KiamacsPackage.TOP_CS__NODE:
return basicSetNode(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 KiamacsPackage.TOP_CS__NODE:
return getNode();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case KiamacsPackage.TOP_CS__NODE:
setNode((NodeCS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case KiamacsPackage.TOP_CS__NODE:
setNode((NodeCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case KiamacsPackage.TOP_CS__NODE:
return node != null;
}
return super.eIsSet(featureID);
}
} //TopCSImpl