| /** |
| * <copyright> |
| * |
| * Copyright (c) 2007, 2008 E.D.Willink and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| * |
| * </copyright> |
| * |
| * $Id: MultiplicityElementImpl.java,v 1.1 2008/07/23 09:55:18 qglineur Exp $ |
| */ |
| package org.eclipse.qvt.declarative.emof.EMOF.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 org.eclipse.qvt.declarative.emof.EMOF.EMOFPackage; |
| import org.eclipse.qvt.declarative.emof.EMOF.MultiplicityElement; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Multiplicity Element</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.qvt.declarative.emof.EMOF.impl.MultiplicityElementImpl#getIsOrdered <em>Is Ordered</em>}</li> |
| * <li>{@link org.eclipse.qvt.declarative.emof.EMOF.impl.MultiplicityElementImpl#getIsUnique <em>Is Unique</em>}</li> |
| * <li>{@link org.eclipse.qvt.declarative.emof.EMOF.impl.MultiplicityElementImpl#getLower <em>Lower</em>}</li> |
| * <li>{@link org.eclipse.qvt.declarative.emof.EMOF.impl.MultiplicityElementImpl#getUpper <em>Upper</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public abstract class MultiplicityElementImpl extends EObjectImpl implements MultiplicityElement { |
| /** |
| * The default value of the '{@link #getIsOrdered() <em>Is Ordered</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIsOrdered() |
| * @generated |
| * @ordered |
| */ |
| protected static final Boolean IS_ORDERED_EDEFAULT = Boolean.FALSE; |
| |
| /** |
| * The cached value of the '{@link #getIsOrdered() <em>Is Ordered</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIsOrdered() |
| * @generated |
| * @ordered |
| */ |
| protected Boolean isOrdered = IS_ORDERED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getIsUnique() <em>Is Unique</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIsUnique() |
| * @generated |
| * @ordered |
| */ |
| protected static final Boolean IS_UNIQUE_EDEFAULT = Boolean.TRUE; |
| |
| /** |
| * The cached value of the '{@link #getIsUnique() <em>Is Unique</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIsUnique() |
| * @generated |
| * @ordered |
| */ |
| protected Boolean isUnique = IS_UNIQUE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLower() <em>Lower</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLower() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer LOWER_EDEFAULT = new Integer(1); |
| |
| /** |
| * The cached value of the '{@link #getLower() <em>Lower</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLower() |
| * @generated |
| * @ordered |
| */ |
| protected Integer lower = LOWER_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getUpper() <em>Upper</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUpper() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer UPPER_EDEFAULT = new Integer(1); |
| |
| /** |
| * The cached value of the '{@link #getUpper() <em>Upper</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUpper() |
| * @generated |
| * @ordered |
| */ |
| protected Integer upper = UPPER_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MultiplicityElementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return EMOFPackage.Literals.MULTIPLICITY_ELEMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Boolean getIsOrdered() { |
| return isOrdered; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIsOrdered(Boolean newIsOrdered) { |
| Boolean oldIsOrdered = isOrdered; |
| isOrdered = newIsOrdered; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED, oldIsOrdered, isOrdered)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Boolean getIsUnique() { |
| return isUnique; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIsUnique(Boolean newIsUnique) { |
| Boolean oldIsUnique = isUnique; |
| isUnique = newIsUnique; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE, oldIsUnique, isUnique)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getLower() { |
| return lower; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLower(Integer newLower) { |
| Integer oldLower = lower; |
| lower = newLower; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.MULTIPLICITY_ELEMENT__LOWER, oldLower, lower)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getUpper() { |
| return upper; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUpper(Integer newUpper) { |
| Integer oldUpper = upper; |
| upper = newUpper; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.MULTIPLICITY_ELEMENT__UPPER, oldUpper, upper)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED: |
| return getIsOrdered(); |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE: |
| return getIsUnique(); |
| case EMOFPackage.MULTIPLICITY_ELEMENT__LOWER: |
| return getLower(); |
| case EMOFPackage.MULTIPLICITY_ELEMENT__UPPER: |
| return getUpper(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED: |
| setIsOrdered((Boolean)newValue); |
| return; |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE: |
| setIsUnique((Boolean)newValue); |
| return; |
| case EMOFPackage.MULTIPLICITY_ELEMENT__LOWER: |
| setLower((Integer)newValue); |
| return; |
| case EMOFPackage.MULTIPLICITY_ELEMENT__UPPER: |
| setUpper((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED: |
| setIsOrdered(IS_ORDERED_EDEFAULT); |
| return; |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE: |
| setIsUnique(IS_UNIQUE_EDEFAULT); |
| return; |
| case EMOFPackage.MULTIPLICITY_ELEMENT__LOWER: |
| setLower(LOWER_EDEFAULT); |
| return; |
| case EMOFPackage.MULTIPLICITY_ELEMENT__UPPER: |
| setUpper(UPPER_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_ORDERED: |
| return IS_ORDERED_EDEFAULT == null ? isOrdered != null : !IS_ORDERED_EDEFAULT.equals(isOrdered); |
| case EMOFPackage.MULTIPLICITY_ELEMENT__IS_UNIQUE: |
| return IS_UNIQUE_EDEFAULT == null ? isUnique != null : !IS_UNIQUE_EDEFAULT.equals(isUnique); |
| case EMOFPackage.MULTIPLICITY_ELEMENT__LOWER: |
| return LOWER_EDEFAULT == null ? lower != null : !LOWER_EDEFAULT.equals(lower); |
| case EMOFPackage.MULTIPLICITY_ELEMENT__UPPER: |
| return UPPER_EDEFAULT == null ? upper != null : !UPPER_EDEFAULT.equals(upper); |
| } |
| 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(" (isOrdered: "); |
| result.append(isOrdered); |
| result.append(", isUnique: "); |
| result.append(isUnique); |
| result.append(", lower: "); |
| result.append(lower); |
| result.append(", upper: "); |
| result.append(upper); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //MultiplicityElementImpl |