/org.eclipse.xtext.example.fj/src-gen/org/eclipse/xtext/example/fj/impl/TypedElementImpl.java
https://bitbucket.org/gcubar/fj-eclipse · Java · 268 lines · 138 code · 22 blank · 108 comment · 24 complexity · b7167ee14b48e5ddf195b22084c0a7cc MD5 · raw file
- /**
- * <copyright>
- * </copyright>
- *
- */
- package org.eclipse.xtext.example.fj.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.emf.ecore.impl.MinimalEObjectImpl;
- import org.eclipse.xtext.example.fj.FjPackage;
- import org.eclipse.xtext.example.fj.Type;
- import org.eclipse.xtext.example.fj.TypedElement;
- /**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Typed Element</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.xtext.example.fj.impl.TypedElementImpl#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.xtext.example.fj.impl.TypedElementImpl#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
- public class TypedElementImpl extends MinimalEObjectImpl.Container implements TypedElement
- {
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected Type type;
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TypedElementImpl()
- {
- super();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return FjPackage.Literals.TYPED_ELEMENT;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Type getType()
- {
- return type;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetType(Type newType, NotificationChain msgs)
- {
- Type oldType = type;
- type = newType;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FjPackage.TYPED_ELEMENT__TYPE, oldType, newType);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setType(Type newType)
- {
- if (newType != type)
- {
- NotificationChain msgs = null;
- if (type != null)
- msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FjPackage.TYPED_ELEMENT__TYPE, null, msgs);
- if (newType != null)
- msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FjPackage.TYPED_ELEMENT__TYPE, null, msgs);
- msgs = basicSetType(newType, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, FjPackage.TYPED_ELEMENT__TYPE, newType, newType));
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, FjPackage.TYPED_ELEMENT__NAME, oldName, name));
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case FjPackage.TYPED_ELEMENT__TYPE:
- return basicSetType(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case FjPackage.TYPED_ELEMENT__TYPE:
- return getType();
- case FjPackage.TYPED_ELEMENT__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case FjPackage.TYPED_ELEMENT__TYPE:
- setType((Type)newValue);
- return;
- case FjPackage.TYPED_ELEMENT__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case FjPackage.TYPED_ELEMENT__TYPE:
- setType((Type)null);
- return;
- case FjPackage.TYPED_ELEMENT__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case FjPackage.TYPED_ELEMENT__TYPE:
- return type != null;
- case FjPackage.TYPED_ELEMENT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
- } //TypedElementImpl