org.eclipse.xtext.xbase.impl.XUnaryOperationImpl 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.XUnaryOperation;
import org.eclipse.xtext.xbase.XbasePackage;
/**
*
* An implementation of the model object 'XUnary Operation'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.xbase.impl.XUnaryOperationImpl#getOperand Operand}
*
*
*
* @generated
*/
public class XUnaryOperationImpl extends XAbstractFeatureCallImplCustom implements XUnaryOperation
{
/**
* The cached value of the '{@link #getOperand() Operand}' containment reference.
*
*
* @see #getOperand()
* @generated
* @ordered
*/
protected XExpression operand;
/**
*
*
* @generated
*/
protected XUnaryOperationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return XbasePackage.Literals.XUNARY_OPERATION;
}
/**
*
*
* @generated
*/
public XExpression getOperand()
{
return operand;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetOperand(XExpression newOperand, NotificationChain msgs)
{
XExpression oldOperand = operand;
operand = newOperand;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XbasePackage.XUNARY_OPERATION__OPERAND, oldOperand, newOperand);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setOperand(XExpression newOperand)
{
if (newOperand != operand)
{
NotificationChain msgs = null;
if (operand != null)
msgs = ((InternalEObject)operand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XUNARY_OPERATION__OPERAND, null, msgs);
if (newOperand != null)
msgs = ((InternalEObject)newOperand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XUNARY_OPERATION__OPERAND, null, msgs);
msgs = basicSetOperand(newOperand, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XUNARY_OPERATION__OPERAND, newOperand, newOperand));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case XbasePackage.XUNARY_OPERATION__OPERAND:
return basicSetOperand(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XbasePackage.XUNARY_OPERATION__OPERAND:
return getOperand();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case XbasePackage.XUNARY_OPERATION__OPERAND:
setOperand((XExpression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case XbasePackage.XUNARY_OPERATION__OPERAND:
setOperand((XExpression)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XUNARY_OPERATION__OPERAND:
return operand != null;
}
return super.eIsSet(featureID);
}
} //XUnaryOperationImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy