| /** |
| */ |
| package configuration.impl; |
| |
| import configuration.ConfigurationPackage; |
| import configuration.Feature; |
| import configuration.FeatureBinding; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Feature</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link configuration.impl.FeatureImpl#getName <em>Name</em>}</li> |
| * <li>{@link configuration.impl.FeatureImpl#getBinding <em>Binding</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class FeatureImpl extends MinimalEObjectImpl.Container implements Feature { |
| /** |
| * 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; |
| |
| /** |
| * The default value of the '{@link #getBinding() <em>Binding</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBinding() |
| * @generated |
| * @ordered |
| */ |
| protected static final FeatureBinding BINDING_EDEFAULT = FeatureBinding.UNBOUND; |
| |
| /** |
| * The cached value of the '{@link #getBinding() <em>Binding</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBinding() |
| * @generated |
| * @ordered |
| */ |
| protected FeatureBinding binding = BINDING_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected FeatureImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ConfigurationPackage.Literals.FEATURE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.FEATURE__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public FeatureBinding getBinding() { |
| return binding; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBinding(FeatureBinding newBinding) { |
| FeatureBinding oldBinding = binding; |
| binding = newBinding == null ? BINDING_EDEFAULT : newBinding; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.FEATURE__BINDING, oldBinding, binding)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ConfigurationPackage.FEATURE__NAME: |
| return getName(); |
| case ConfigurationPackage.FEATURE__BINDING: |
| return getBinding(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ConfigurationPackage.FEATURE__NAME: |
| setName((String)newValue); |
| return; |
| case ConfigurationPackage.FEATURE__BINDING: |
| setBinding((FeatureBinding)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ConfigurationPackage.FEATURE__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case ConfigurationPackage.FEATURE__BINDING: |
| setBinding(BINDING_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ConfigurationPackage.FEATURE__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case ConfigurationPackage.FEATURE__BINDING: |
| return binding != BINDING_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (name: "); |
| result.append(name); |
| result.append(", binding: "); |
| result.append(binding); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //FeatureImpl |