blob: 2d9a697cefa699bb034492233197781a029f060a [file] [log] [blame]
/**
* <copyright>
* Copyright (c) 2009, 2010 Open Canarias, S.L.
* 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:
* Adolfo Sanchez-Barbudo Herrera - Initial API and implementation
*
* </copyright>
*/
package org.eclipse.modisco.omg.gastm.impl;
import java.lang.Integer;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.modisco.omg.gastm.GASTMPackage;
import org.eclipse.modisco.omg.gastm.RealType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Real Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.modisco.omg.gastm.impl.RealTypeImpl#getPrecision <em>Precision</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class RealTypeImpl extends NumberTypeImpl implements RealType {
/**
* The default value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPrecision()
* @generated
* @ordered
*/
protected static final Integer PRECISION_EDEFAULT = null;
/**
* The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPrecision()
* @generated
* @ordered
*/
protected Integer precision = PRECISION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RealTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return GASTMPackage.eINSTANCE.getRealType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Integer getPrecision() {
return precision;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPrecision(Integer newPrecision) {
Integer oldPrecision = precision;
precision = newPrecision;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GASTMPackage.REAL_TYPE__PRECISION, oldPrecision, precision));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case GASTMPackage.REAL_TYPE__PRECISION:
return getPrecision();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case GASTMPackage.REAL_TYPE__PRECISION:
setPrecision((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case GASTMPackage.REAL_TYPE__PRECISION:
setPrecision(PRECISION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case GASTMPackage.REAL_TYPE__PRECISION:
return PRECISION_EDEFAULT == null ? precision != null : !PRECISION_EDEFAULT.equals(precision);
}
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(" (precision: "); //$NON-NLS-1$
result.append(precision);
result.append(')');
return result.toString();
}
} //RealTypeImpl