blob: 3d6d495afb1b554463a07f84a2ee827be716327d [file] [log] [blame]
/**
* Copyright (c) 2016 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:
* CEA LIST - Initial API and implementation
*/
package org.eclipse.papyrus.moka.fmi.modeldescription.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.MinimalEObjectImpl;
import org.eclipse.papyrus.moka.fmi.modeldescription.FmiPackage;
import org.eclipse.papyrus.moka.fmi.modeldescription.IntegerType1;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Integer Type1</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.IntegerType1Impl#getMax <em>Max</em>}</li>
* <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.IntegerType1Impl#getMin <em>Min</em>}</li>
* <li>{@link org.eclipse.papyrus.moka.fmi.modeldescription.impl.IntegerType1Impl#getQuantity <em>Quantity</em>}</li>
* </ul>
*
* @generated
*/
public class IntegerType1Impl extends MinimalEObjectImpl.Container implements IntegerType1 {
/**
* The default value of the '{@link #getMax() <em>Max</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax()
* @generated
* @ordered
*/
protected static final int MAX_EDEFAULT = 0;
/**
* The cached value of the '{@link #getMax() <em>Max</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax()
* @generated
* @ordered
*/
protected int max = MAX_EDEFAULT;
/**
* This is true if the Max attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean maxESet;
/**
* The default value of the '{@link #getMin() <em>Min</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected static final int MIN_EDEFAULT = 0;
/**
* The cached value of the '{@link #getMin() <em>Min</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected int min = MIN_EDEFAULT;
/**
* This is true if the Min attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean minESet;
/**
* The default value of the '{@link #getQuantity() <em>Quantity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQuantity()
* @generated
* @ordered
*/
protected static final String QUANTITY_EDEFAULT = null;
/**
* The cached value of the '{@link #getQuantity() <em>Quantity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQuantity()
* @generated
* @ordered
*/
protected String quantity = QUANTITY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IntegerType1Impl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FmiPackage.Literals.INTEGER_TYPE1;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getMax() {
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMax(int newMax) {
int oldMax = max;
max = newMax;
boolean oldMaxESet = maxESet;
maxESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FmiPackage.INTEGER_TYPE1__MAX, oldMax, max, !oldMaxESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetMax() {
int oldMax = max;
boolean oldMaxESet = maxESet;
max = MAX_EDEFAULT;
maxESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, FmiPackage.INTEGER_TYPE1__MAX, oldMax, MAX_EDEFAULT, oldMaxESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetMax() {
return maxESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getMin() {
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMin(int newMin) {
int oldMin = min;
min = newMin;
boolean oldMinESet = minESet;
minESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FmiPackage.INTEGER_TYPE1__MIN, oldMin, min, !oldMinESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetMin() {
int oldMin = min;
boolean oldMinESet = minESet;
min = MIN_EDEFAULT;
minESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, FmiPackage.INTEGER_TYPE1__MIN, oldMin, MIN_EDEFAULT, oldMinESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetMin() {
return minESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getQuantity() {
return quantity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setQuantity(String newQuantity) {
String oldQuantity = quantity;
quantity = newQuantity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FmiPackage.INTEGER_TYPE1__QUANTITY, oldQuantity, quantity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FmiPackage.INTEGER_TYPE1__MAX:
return getMax();
case FmiPackage.INTEGER_TYPE1__MIN:
return getMin();
case FmiPackage.INTEGER_TYPE1__QUANTITY:
return getQuantity();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FmiPackage.INTEGER_TYPE1__MAX:
setMax((Integer)newValue);
return;
case FmiPackage.INTEGER_TYPE1__MIN:
setMin((Integer)newValue);
return;
case FmiPackage.INTEGER_TYPE1__QUANTITY:
setQuantity((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FmiPackage.INTEGER_TYPE1__MAX:
unsetMax();
return;
case FmiPackage.INTEGER_TYPE1__MIN:
unsetMin();
return;
case FmiPackage.INTEGER_TYPE1__QUANTITY:
setQuantity(QUANTITY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FmiPackage.INTEGER_TYPE1__MAX:
return isSetMax();
case FmiPackage.INTEGER_TYPE1__MIN:
return isSetMin();
case FmiPackage.INTEGER_TYPE1__QUANTITY:
return QUANTITY_EDEFAULT == null ? quantity != null : !QUANTITY_EDEFAULT.equals(quantity);
}
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(" (max: ");
if (maxESet) result.append(max); else result.append("<unset>");
result.append(", min: ");
if (minESet) result.append(min); else result.append("<unset>");
result.append(", quantity: ");
result.append(quantity);
result.append(')');
return result.toString();
}
} //IntegerType1Impl