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

sculptormetamodel.impl.EnumImpl Maven / Gradle / Ivy

/**
 */
package sculptormetamodel.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import sculptormetamodel.EnumValue;
import sculptormetamodel.SculptormetamodelPackage;

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

* The following features are implemented: *

    *
  • {@link sculptormetamodel.impl.EnumImpl#getValues Values}
  • *
  • {@link sculptormetamodel.impl.EnumImpl#isOrdinal Ordinal}
  • *
*

* * @generated */ public class EnumImpl extends DomainObjectImpl implements sculptormetamodel.Enum { /** * The cached value of the '{@link #getValues() Values}' containment reference list. * * * @see #getValues() * @generated * @ordered */ protected EList values; /** * The default value of the '{@link #isOrdinal() Ordinal}' attribute. * * * @see #isOrdinal() * @generated * @ordered */ protected static final boolean ORDINAL_EDEFAULT = false; /** * The cached value of the '{@link #isOrdinal() Ordinal}' attribute. * * * @see #isOrdinal() * @generated * @ordered */ protected boolean ordinal = ORDINAL_EDEFAULT; /** * * * @generated */ protected EnumImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SculptormetamodelPackage.Literals.ENUM; } /** * * * @generated */ public EList getValues() { if (values == null) { values = new EObjectContainmentEList(EnumValue.class, this, SculptormetamodelPackage.ENUM__VALUES); } return values; } /** * * * @generated */ public boolean isOrdinal() { return ordinal; } /** * * * @generated */ public void setOrdinal(boolean newOrdinal) { boolean oldOrdinal = ordinal; ordinal = newOrdinal; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SculptormetamodelPackage.ENUM__ORDINAL, oldOrdinal, ordinal)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SculptormetamodelPackage.ENUM__VALUES: return ((InternalEList)getValues()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SculptormetamodelPackage.ENUM__VALUES: return getValues(); case SculptormetamodelPackage.ENUM__ORDINAL: return isOrdinal(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SculptormetamodelPackage.ENUM__VALUES: getValues().clear(); getValues().addAll((Collection)newValue); return; case SculptormetamodelPackage.ENUM__ORDINAL: setOrdinal((Boolean)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SculptormetamodelPackage.ENUM__VALUES: getValues().clear(); return; case SculptormetamodelPackage.ENUM__ORDINAL: setOrdinal(ORDINAL_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SculptormetamodelPackage.ENUM__VALUES: return values != null && !values.isEmpty(); case SculptormetamodelPackage.ENUM__ORDINAL: return ordinal != ORDINAL_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (ordinal: "); result.append(ordinal); result.append(')'); return result.toString(); } } //EnumImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy