/** | |
* Copyright (c) 2018 CEA LIST. | |
* | |
* 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: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.formalml.expression.impl; | |
import org.eclipse.efm.ecore.formalml.expression.ExpressionPackage; | |
import org.eclipse.efm.ecore.formalml.expression.LiteralParentExpression; | |
import org.eclipse.efm.ecore.formalml.infrastructure.Machine; | |
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>Literal Parent Expression</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.expression.impl.LiteralParentExpressionImpl#getModel <em>Model</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class LiteralParentExpressionImpl extends LiteralReferenceExpressionImpl implements LiteralParentExpression { | |
/** | |
* The cached value of the '{@link #getModel() <em>Model</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getModel() | |
* @generated | |
* @ordered | |
*/ | |
protected Machine model; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected LiteralParentExpressionImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ExpressionPackage.Literals.LITERAL_PARENT_EXPRESSION; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Machine getModel() { | |
if (model != null && model.eIsProxy()) { | |
InternalEObject oldModel = (InternalEObject)model; | |
model = (Machine)eResolveProxy(oldModel); | |
if (model != oldModel) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExpressionPackage.LITERAL_PARENT_EXPRESSION__MODEL, oldModel, model)); | |
} | |
} | |
return model; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Machine basicGetModel() { | |
return model; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setModel(Machine newModel) { | |
Machine oldModel = model; | |
model = newModel; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.LITERAL_PARENT_EXPRESSION__MODEL, oldModel, model)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_PARENT_EXPRESSION__MODEL: | |
if (resolve) return getModel(); | |
return basicGetModel(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_PARENT_EXPRESSION__MODEL: | |
setModel((Machine)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_PARENT_EXPRESSION__MODEL: | |
setModel((Machine)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_PARENT_EXPRESSION__MODEL: | |
return model != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //LiteralParentExpressionImpl |