/** * <copyright> * </copyright> * * $Id$ */ package soamodel.impl; 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.EObjectImpl; import soamodel.OCLConstraint; import soamodel.SoamodelPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>OCL Constraint</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link soamodel.impl.OCLConstraintImpl#getConstraint <em>Constraint</em>}</li> * <li>{@link soamodel.impl.OCLConstraintImpl#getDescription <em>Description</em>}</li> * </ul> * </p> * * @generated */ public abstract class OCLConstraintImpl extends EObjectImpl implements OCLConstraint { /** * The default value of the '{@link #getConstraint() <em>Constraint</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getConstraint() * @generated * @ordered */ protected static final String CONSTRAINT_EDEFAULT = null; /** * The cached value of the '{@link #getConstraint() <em>Constraint</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getConstraint() * @generated * @ordered */ protected String constraint = CONSTRAINT_EDEFAULT; /** * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected OCLConstraintImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return SoamodelPackage.Literals.OCL_CONSTRAINT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getConstraint() { return constraint; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setConstraint(String newConstraint) { String oldConstraint = constraint; constraint = newConstraint; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SoamodelPackage.OCL_CONSTRAINT__CONSTRAINT, oldConstraint, constraint)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getDescription() { return description; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SoamodelPackage.OCL_CONSTRAINT__DESCRIPTION, oldDescription, description)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SoamodelPackage.OCL_CONSTRAINT__CONSTRAINT: return getConstraint(); case SoamodelPackage.OCL_CONSTRAINT__DESCRIPTION: return getDescription(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case SoamodelPackage.OCL_CONSTRAINT__CONSTRAINT: setConstraint((String)newValue); return; case SoamodelPackage.OCL_CONSTRAINT__DESCRIPTION: setDescription((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case SoamodelPackage.OCL_CONSTRAINT__CONSTRAINT: setConstraint(CONSTRAINT_EDEFAULT); return; case SoamodelPackage.OCL_CONSTRAINT__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case SoamodelPackage.OCL_CONSTRAINT__CONSTRAINT: return CONSTRAINT_EDEFAULT == null ? constraint != null : !CONSTRAINT_EDEFAULT.equals(constraint); case SoamodelPackage.OCL_CONSTRAINT__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (constraint: "); result.append(constraint); result.append(", description: "); result.append(description); result.append(')'); return result.toString(); } } //OCLConstraintImpl