diff options
Diffstat (limited to 'extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/infrastructure/datatypes/impl/EAFloatImpl.java')
-rw-r--r-- | extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/infrastructure/datatypes/impl/EAFloatImpl.java | 227 |
1 files changed, 227 insertions, 0 deletions
diff --git a/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/infrastructure/datatypes/impl/EAFloatImpl.java b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/infrastructure/datatypes/impl/EAFloatImpl.java new file mode 100644 index 00000000000..65b5c7a1adb --- /dev/null +++ b/extraplugins/eastadl/org.eclipse.papyrus.eastadl/src/org/eclipse/papyrus/eastadl/infrastructure/datatypes/impl/EAFloatImpl.java @@ -0,0 +1,227 @@ +/***************************************************************************** + * Copyright (c) 2010 CEA LIST. + * + * + * 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: + * Sara TUCCI (CEA LIST) sara.tucci@cea.fr - Initial API and implementation + * Chokri MRAIDHA (CEA LIST) chokri.mraidha@cea.fr - Initial API and implementation + * David SERVAT (CEA LIST) david.servat@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.eastadl.infrastructure.datatypes.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.eastadl.infrastructure.datatypes.DatatypesPackage; +import org.eclipse.papyrus.eastadl.infrastructure.datatypes.EAFloat; + + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>EA Float</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.papyrus.eastadl.infrastructure.datatypes.impl.EAFloatImpl#getMin <em>Min</em>}</li> + * <li>{@link org.eclipse.papyrus.eastadl.infrastructure.datatypes.impl.EAFloatImpl#getMax <em>Max</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class EAFloatImpl extends RangeableDatatypeImpl implements EAFloat { + /** + * The default value of the '{@link #getMin() <em>Min</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMin() + * @generated + * @ordered + */ + protected static final Float MIN_EDEFAULT = null; + + /** + * The cached value of the '{@link #getMin() <em>Min</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMin() + * @generated + * @ordered + */ + protected Float min = MIN_EDEFAULT; + + /** + * The default value of the '{@link #getMax() <em>Max</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMax() + * @generated + * @ordered + */ + protected static final Float MAX_EDEFAULT = null; + + /** + * The cached value of the '{@link #getMax() <em>Max</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMax() + * @generated + * @ordered + */ + protected Float max = MAX_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected EAFloatImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DatatypesPackage.EA_FLOAT__MIN: + return getMin(); + case DatatypesPackage.EA_FLOAT__MAX: + return getMax(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DatatypesPackage.EA_FLOAT__MIN: + return MIN_EDEFAULT == null ? min != null : !MIN_EDEFAULT.equals(min); + case DatatypesPackage.EA_FLOAT__MAX: + return MAX_EDEFAULT == null ? max != null : !MAX_EDEFAULT.equals(max); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DatatypesPackage.EA_FLOAT__MIN: + setMin((Float)newValue); + return; + case DatatypesPackage.EA_FLOAT__MAX: + setMax((Float)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return DatatypesPackage.Literals.EA_FLOAT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DatatypesPackage.EA_FLOAT__MIN: + setMin(MIN_EDEFAULT); + return; + case DatatypesPackage.EA_FLOAT__MAX: + setMax(MAX_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Float getMax() { + return max; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Float getMin() { + return min; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setMax(Float newMax) { + Float oldMax = max; + max = newMax; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DatatypesPackage.EA_FLOAT__MAX, oldMax, max)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setMin(Float newMin) { + Float oldMin = min; + min = newMin; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, DatatypesPackage.EA_FLOAT__MIN, oldMin, min)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (min: "); + result.append(min); + result.append(", max: "); + result.append(max); + result.append(')'); + return result.toString(); + } + +} //EAFloatImpl |