All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.xtext.impl.ActionImpl Maven / Gradle / Ivy

There is a newer version: 2.4.3
Show newest version
/**
 * 
 * 
 *
 * $Id: ActionImpl.java,v 1.16 2010/04/06 14:10:05 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.Action;
import org.eclipse.xtext.TypeRef;
import org.eclipse.xtext.XtextPackage;

/**
 * 
 * An implementation of the model object 'Action'.
 * 
 * 

* The following features are implemented: *

    *
  • {@link org.eclipse.xtext.impl.ActionImpl#getType Type}
  • *
  • {@link org.eclipse.xtext.impl.ActionImpl#getFeature Feature}
  • *
  • {@link org.eclipse.xtext.impl.ActionImpl#getOperator Operator}
  • *
*

* * @generated */ public class ActionImpl extends AbstractElementImpl implements Action { /** * The cached value of the '{@link #getType() Type}' containment reference. * * * @see #getType() * @generated * @ordered */ protected TypeRef type; /** * 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; /** * * * @generated */ protected ActionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return XtextPackage.Literals.ACTION; } /** * * * @generated */ public TypeRef getType() { return type; } /** * * * @generated */ public NotificationChain basicSetType(TypeRef newType, NotificationChain msgs) { TypeRef oldType = type; type = newType; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.ACTION__TYPE, oldType, newType); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setType(TypeRef newType) { if (newType != type) { NotificationChain msgs = null; if (type != null) msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.ACTION__TYPE, null, msgs); if (newType != null) msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.ACTION__TYPE, null, msgs); msgs = basicSetType(newType, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.ACTION__TYPE, newType, newType)); } /** * * * @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.ACTION__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.ACTION__OPERATOR, oldOperator, operator)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case XtextPackage.ACTION__TYPE: return basicSetType(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XtextPackage.ACTION__TYPE: return getType(); case XtextPackage.ACTION__FEATURE: return getFeature(); case XtextPackage.ACTION__OPERATOR: return getOperator(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case XtextPackage.ACTION__TYPE: setType((TypeRef)newValue); return; case XtextPackage.ACTION__FEATURE: setFeature((String)newValue); return; case XtextPackage.ACTION__OPERATOR: setOperator((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case XtextPackage.ACTION__TYPE: setType((TypeRef)null); return; case XtextPackage.ACTION__FEATURE: setFeature(FEATURE_EDEFAULT); return; case XtextPackage.ACTION__OPERATOR: setOperator(OPERATOR_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case XtextPackage.ACTION__TYPE: return type != null; case XtextPackage.ACTION__FEATURE: return FEATURE_EDEFAULT == null ? feature != null : !FEATURE_EDEFAULT.equals(feature); case XtextPackage.ACTION__OPERATOR: return OPERATOR_EDEFAULT == null ? operator != null : !OPERATOR_EDEFAULT.equals(operator); } 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(); } } //ActionImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy