org.eclipse.xtext.xbase.impl.XSynchronizedExpressionImpl Maven / Gradle / Ivy
/**
* Copyright (c) 2011 itemis AG (http://www.itemis.eu) 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
*/
package org.eclipse.xtext.xbase.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.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.XSynchronizedExpression;
import org.eclipse.xtext.xbase.XbasePackage;
/**
*
* An implementation of the model object 'XSynchronized Expression'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.xtext.xbase.impl.XSynchronizedExpressionImpl#getParam Param}
* - {@link org.eclipse.xtext.xbase.impl.XSynchronizedExpressionImpl#getExpression Expression}
*
*
* @generated
*/
public class XSynchronizedExpressionImpl extends XExpressionImpl implements XSynchronizedExpression
{
/**
* The cached value of the '{@link #getParam() Param}' containment reference.
*
*
* @see #getParam()
* @generated
* @ordered
*/
protected XExpression param;
/**
* The cached value of the '{@link #getExpression() Expression}' containment reference.
*
*
* @see #getExpression()
* @generated
* @ordered
*/
protected XExpression expression;
/**
*
*
* @generated
*/
protected XSynchronizedExpressionImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return XbasePackage.Literals.XSYNCHRONIZED_EXPRESSION;
}
/**
*
*
* @generated
*/
public XExpression getParam()
{
return param;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetParam(XExpression newParam, NotificationChain msgs)
{
XExpression oldParam = param;
param = newParam;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, oldParam, newParam);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setParam(XExpression newParam)
{
if (newParam != param)
{
NotificationChain msgs = null;
if (param != null)
msgs = ((InternalEObject)param).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, null, msgs);
if (newParam != null)
msgs = ((InternalEObject)newParam).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, null, msgs);
msgs = basicSetParam(newParam, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, newParam, newParam));
}
/**
*
*
* @generated
*/
public XExpression getExpression()
{
return expression;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetExpression(XExpression newExpression, NotificationChain msgs)
{
XExpression oldExpression = expression;
expression = newExpression;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION, oldExpression, newExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setExpression(XExpression newExpression)
{
if (newExpression != expression)
{
NotificationChain msgs = null;
if (expression != null)
msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION, null, msgs);
if (newExpression != null)
msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION, null, msgs);
msgs = basicSetExpression(newExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION, newExpression, newExpression));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM:
return basicSetParam(null, msgs);
case XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION:
return basicSetExpression(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM:
return getParam();
case XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION:
return getExpression();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM:
setParam((XExpression)newValue);
return;
case XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION:
setExpression((XExpression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM:
setParam((XExpression)null);
return;
case XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION:
setExpression((XExpression)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM:
return param != null;
case XbasePackage.XSYNCHRONIZED_EXPRESSION__EXPRESSION:
return expression != null;
}
return super.eIsSet(featureID);
}
} //XSynchronizedExpressionImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy