org.eclipse.xtext.impl.AssignmentImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: AssignmentImpl.java,v 1.16 2010/04/06 14:09:59 sefftinge Exp $
*/
package org.eclipse.xtext.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.AbstractElement;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.XtextPackage;
/**
*
* An implementation of the model object 'Assignment'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.impl.AssignmentImpl#getFeature Feature}
* - {@link org.eclipse.xtext.impl.AssignmentImpl#getOperator Operator}
* - {@link org.eclipse.xtext.impl.AssignmentImpl#getTerminal Terminal}
*
*
*
* @generated
*/
public class AssignmentImpl extends AbstractElementImpl implements Assignment {
/**
* The default value of the '{@link #getFeature() Feature}' attribute.
*
*
* @see #getFeature()
* @generated
* @ordered
*/
protected static final String FEATURE_EDEFAULT = null;
/**
* The cached value of the '{@link #getFeature() Feature}' attribute.
*
*
* @see #getFeature()
* @generated
* @ordered
*/
protected String feature = FEATURE_EDEFAULT;
/**
* The default value of the '{@link #getOperator() Operator}' attribute.
*
*
* @see #getOperator()
* @generated
* @ordered
*/
protected static final String OPERATOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getOperator() Operator}' attribute.
*
*
* @see #getOperator()
* @generated
* @ordered
*/
protected String operator = OPERATOR_EDEFAULT;
/**
* The cached value of the '{@link #getTerminal() Terminal}' containment reference.
*
*
* @see #getTerminal()
* @generated
* @ordered
*/
protected AbstractElement terminal;
/**
*
*
* @generated
*/
protected AssignmentImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.ASSIGNMENT;
}
/**
*
*
* @generated
*/
public String getFeature() {
return feature;
}
/**
*
*
* @generated
*/
public void setFeature(String newFeature) {
String oldFeature = feature;
feature = newFeature;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.ASSIGNMENT__FEATURE, oldFeature, feature));
}
/**
*
*
* @generated
*/
public String getOperator() {
return operator;
}
/**
*
*
* @generated
*/
public void setOperator(String newOperator) {
String oldOperator = operator;
operator = newOperator;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.ASSIGNMENT__OPERATOR, oldOperator, operator));
}
/**
*
*
* @generated
*/
public AbstractElement getTerminal() {
return terminal;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTerminal(AbstractElement newTerminal, NotificationChain msgs) {
AbstractElement oldTerminal = terminal;
terminal = newTerminal;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.ASSIGNMENT__TERMINAL, oldTerminal, newTerminal);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTerminal(AbstractElement newTerminal) {
if (newTerminal != terminal) {
NotificationChain msgs = null;
if (terminal != null)
msgs = ((InternalEObject)terminal).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.ASSIGNMENT__TERMINAL, null, msgs);
if (newTerminal != null)
msgs = ((InternalEObject)newTerminal).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.ASSIGNMENT__TERMINAL, null, msgs);
msgs = basicSetTerminal(newTerminal, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.ASSIGNMENT__TERMINAL, newTerminal, newTerminal));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case XtextPackage.ASSIGNMENT__TERMINAL:
return basicSetTerminal(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XtextPackage.ASSIGNMENT__FEATURE:
return getFeature();
case XtextPackage.ASSIGNMENT__OPERATOR:
return getOperator();
case XtextPackage.ASSIGNMENT__TERMINAL:
return getTerminal();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.ASSIGNMENT__FEATURE:
setFeature((String)newValue);
return;
case XtextPackage.ASSIGNMENT__OPERATOR:
setOperator((String)newValue);
return;
case XtextPackage.ASSIGNMENT__TERMINAL:
setTerminal((AbstractElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case XtextPackage.ASSIGNMENT__FEATURE:
setFeature(FEATURE_EDEFAULT);
return;
case XtextPackage.ASSIGNMENT__OPERATOR:
setOperator(OPERATOR_EDEFAULT);
return;
case XtextPackage.ASSIGNMENT__TERMINAL:
setTerminal((AbstractElement)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case XtextPackage.ASSIGNMENT__FEATURE:
return FEATURE_EDEFAULT == null ? feature != null : !FEATURE_EDEFAULT.equals(feature);
case XtextPackage.ASSIGNMENT__OPERATOR:
return OPERATOR_EDEFAULT == null ? operator != null : !OPERATOR_EDEFAULT.equals(operator);
case XtextPackage.ASSIGNMENT__TERMINAL:
return terminal != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (feature: ");
result.append(feature);
result.append(", operator: ");
result.append(operator);
result.append(')');
return result.toString();
}
} //AssignmentImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy